javascript - Using jQuery's setTimout() Function For Anchor Scrolling -
I am still learning how to use jQuery and I have this script which gives anchors smooth scroll to my page Does. Before I start scrolling, I should wait that there is a menu that needs to be closed. I think I need to use the setTimeout () function, but do not understand it Finding how to implement it correctly in my code.
and lieutenant; Script & gt; $ (Document) .ready (function () {$ ('a [href ^ = "#"]'). ('Click', function (e) {e.preventDefault (); var target = this.hash, $ Target = $ (target); $ ('html, body'). Stop (). ({'ScrollTop': $ target.offset (.) Top-2}, 900, 'easeinOutExpo', function () { Window.location.hash = Target;});});}); & Lt; / Script & gt; Animate in timeout:
setTimeout (function () {$ ('html, body'). Stop (). Chetan ({'scrollTop': $ target.offset () Top-2, 900, 'Kamiren AutoExpo ', Function () {window.location.hash = target;});}, 1000);
Comments
Post a Comment