jQuery .toggle event deprecated, What to use? -
since jquery .toggle event method deprecated. suppose use simulate event (alternate clicks)?
add outside of document.ready
$.fn.clicktoggle = function(a, b) { return this.each(function() { var clicked = false; $(this).click(function() { if (clicked) { clicked = false; return b.apply(this, arguments); } clicked = true; return a.apply(this, arguments); }); }); };
then use following replicate .toggle functionality:
$("#mydiv").clicktoggle(functiona,functionb);
found on jquery forums
Comments
Post a Comment