Closed ghost closed 8 years ago
Thanks for reporting this issue. One way to do this is to use event
to determine what was actually clicked. If you're using jQuery, get the clicked element with event.originalEvent.target
. You can then you can get a parent element .closest()
. See demo http://codepen.io/desandro/pen/xwYgPV?editors=001
$gallery.on( 'staticClick', function( event ) {
var $button = $(event.originalEvent.target).closest('button');
if ( $button.length ) {
$logger.text( $button.attr('class') + ' clicked')
}
});
Hi, I'm using your slider and for the most part it's great but I do have this issue where I have multiple element in the slider and within each element I have a couple of buttons that trigger specific events using Javascript. I'm trying to use the staticClick function on these but I can't figure out how.
Basic structure is:
So basically, I need the buttons to only trigger their events on staticClick and not on the standard click event in JS.
Any help would be greatly appreciated.