I'm trying to revive a This script is: and CSS element: and website: because the button is a about scrollp action when I return to the top button However, it pulls back to the top without animation, can it be the CSS parameter error?
& lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / jquery.sticky.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ (Window) .scroll (function () {if ($ (this) .scrollTop ()> 990) {$ ('.schup'). FadeIn (600)} and {$ ('.schup'). FadeOut ( 300)}}); $ ('.schup'). Click (function () {$ ('html, body'). Animate ({scrollTop: 0}, 600); return;}); & Lt; / Script & gt;
& lt; Div id = "toparrow" & gt; & Lt; A href = "#" class = "scrollup" & gt; Scroll & lt; / A & gt; & Lt; / Div & gt;
#toparrow {} .scrollup {width: 72px; Height: 45px; Top: 240px; Left: 927px; Status: Completed; Background: url ('../ img / generic / toparrow.png') below; display none; Text Indent: -9999px; }
href = "#" means that you go to the top section You can use
preventDefault to change this browser behavior.
$ ('. Scrollup'). Click (function (e) {e.preventDefault (); $ ('Html, body'). Animate ({scrollTop: 0}, 600); return;});
event.preventDefault :
No comments:
Post a Comment