javascript - Remysharp's js Inview plugin fired velocity transition twice -


i'm using remysharp in view plugin determine when element in view. when in view, use velocity show element in. reason, inside of in view call, animation triggers twice. outside of in view call, works should.

why firing twice?

$(".xslideupin").one('inview', function (event, visible) {       if (visible == true) {          $(".xslideupin").velocity('transition.slideupin', { stagger: 700 }).delay(1000)       } else {         // element has gone out of viewport       } }); 

try with

$(".xslideupin").one('inview', function (event, visible) {   if (visible == true) {      settimeout(function() {        $(".xslideupin").velocity('transition.slideupin', { stagger: 700 }).delay(1000)      }, 0);   } else {     // element has gone out of viewport   } }); 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -