tags:

views:

212

answers:

2

Hi,

I need to target all links with a class of hslide and attach this to them. Any jquery guru's out there know how to do this?

onclick="return hs.expand(this, { slideshowGroup: 'groupC0',  wrapperClassName: 'rounded-white', outlineType : 'rounded-white', dimmingOpacity: 0.8,  align : 'center',  transitions : ['expand', 'crossfade'], fadeInOut: true });"

Thanks, C

+6  A: 
$(document).ready(function() {
    $('a.hslide').click(function() {
        return hs.expand(this, {
            slideshowGroup: 'groupC0',
            wrapperClassName: 'rounded-white',
            outlineType : 'rounded-white',
            dimmingOpacity: 0.8,
            align : 'center',
            transitions : ['expand', 'crossfade'],
            fadeInOut: true
        });
    });
});
Ken Browning
There seems to be a problem where this is breaking the functionality. Will try looking into it a bit more.
Model Reject
set a breakpoint and examine the value of `this` on line 3.
Ken Browning
+1  A: 

Set a class on that object, then select it with jQuery and then add the onclick event to an anonymous function.

$(document).ready(function() {
   $(INSERT CLASS HERE).click(function() {
       return hs.expand(this, {
           slideshowGroup: 'groupC0',
           wrapperClassName: 'rounded-white',
           outlineType : 'rounded-white',
           dimmingOpacity: 0.8,
           align : 'center',
           transitions : ['expand', 'crossfade'],
           fadeInOut: true
       });
   });
});
jpabluz