jquery - How to run these functions one after the other? -


how can have these functions run 1 after other, each 1 finished before next starts?

        $(window).unbind();          $('.buyersseclink').removeclass('buyersseclinkon');          $(this).parent().delay(900).addclass('buyersseclinkon');          $(window).bind('scroll', function () {              $('.buyersseclink').removeclass('buyersseclinkon');         }); 

thanks

delay() not work methods such addcless. jquery documentation suggests should use settimeout instead:

   $(window).unbind();     $('.buyersseclink').removeclass('buyersseclinkon');     var current = this; // store reference, because in settimeout callback "this" maybe referring else     window.settimeout(function() {      $(current ).parent().addclass('buyersseclinkon');      $(window).bind('scroll', function () {         $('.buyersseclink').removeclass('buyersseclinkon');      });    }, 900); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -