Created
September 16, 2013 03:48
-
-
Save nagataka/6576539 to your computer and use it in GitHub Desktop.
template of making "page top" link using jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//script | |
$(function() { | |
topBtn.click(function () { | |
$('body,html').animate({ | |
scrollTop: 0 | |
}, 1000); | |
return false; | |
}); | |
}); | |
//css | |
#pageTop{ | |
background:#DDD; | |
color:#FFF; | |
border-radius:8px; | |
padding:10px; | |
position:fixed; | |
bottom:20px; | |
right:20px; | |
} | |
//html | |
<a id="pageTop" href="#topContent">Page top</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment