javascript - How to delay animation -


I have a jQuery animation that opens the pane and .op / P>

When the screen opens automatically when the page is loaded

  $ (".rope"). Triggers ('Clicks');  

At the end of the string.

The complete code works great but when the page loads, I want to delay the seconds before opening the curtains but not on the click. I have tried to add. Della (2000) First and foremost First, I am passing around with a set timeout, but I'm not sure where to place it or if it is also important for me. My javascript skill is very basic here what I'm using I just want to add delay

  jQuery (document) .ready (function ($) {$ curtainopen = false; $ (" Rope "). (Function () {$ (.) .blur (); if ($ curtainopen == incorrect) {$ (this) .stop (). Animate ({top: '0px'}, {queue : False, duration: 500, easy: 'easeOutBounce'} $ (".bencracker"). Stop (): ({width: '60px'}, 2000); $ (".writer"). Animate ({width: '60px'}, 2000 $ ("top: '-40px'}, {line: false, duration: 500, ease: 'easy oh Chest ({width: '51% '}, 2000); $ patentain = $ ("{width: False;} return false;}); $ ("rope"). Trigger ('click');});  

A timeout will be ideal for this, I think.

  var autoOpen = setTimeout (function () {$ (". Rope "). The trigger ("click");}, 2000);  

Be sure to add it inside your $ (". Rope"). (...) function:

  clearTimeout (AutoOpen);  

will ensure that the user manually clicks, then it "opens automatically after two seconds" which otherwise might interfere;)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -