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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -