Saturday, 15 June 2013

javascript - Jquery - click on element generated by jquery function -



javascript - Jquery - click on element generated by jquery function -

i have jquery slider (nivo slider) generates next , prev button jquery. i'm trying add together hide() action div on buttons.

$(document).ready(function(){ $(".nivo-prevnav").live('click', function() { $("#slide3").hide(); }); });

.nivo-prevnav class generated jquery function of slider

any ideas on how can prepare because not working

.live() has been deprecated. utilize .on() instead:

$(document).on("click", ".nivo-prevnav", function() { $("#slide3").hide(); });

for improve performance, should phone call .on() on closest parent that's available before nivo plugin runs:

$("#nivo-wrapper").on("click", ".nivo-prevnav", function() { $("#slide3").hide(); });

you should alter #nivo-wrapper whatever element you're calling nivo slider on.

javascript jquery live

No comments:

Post a Comment