javascript - jQuery Destroy / Disable / Trigger Once Waypoints -
i'm trying use imakewebthings waypoints
daniel eden's animate.css
file essentially, have form
appear once enters viewport. once form
submitted, should disappear , never reappear.
everything working perfectly, except once form submitted, reappears after scrolling , down page. i'm trying either destroy
or triggeronce
waypoint after completes first time, i'm not having luck.
some searches have led me learn these .destroy
, etc. javascript methods there anyway accomplish have or need rewrite it?
waypoint:
$('#contactform').waypoint(function() { $('#contactform').show().addclass('animated fadeinup').one('webkitanimationend mozanimationend msanimationend oanimationend animationend', function() { $('#contactform').removeclass('animated fadeinup'); }); }, { triggeronce: true });
ah simple fix.
$('#contactform').waypoint(function() { $('#contactform').show().addclass('animated fadeinup').one('webkitanimationend mozanimationend msanimationend oanimationend animationend', function() { $('#contactform').removeclass('animated fadeinup'); }); this.destroy(); }, { triggeronce: true });
found answer here
Comments
Post a Comment