Jun
10
2013
10
2013
Scroll to top
A snippet by admin
No Comments
<a href="javascript:void(0);" onclick="jQuery('html, body').animate( { scrollTop: 0 }, 'slow' );">Go to top</a>
Or as a click handler:
$('body').on('click', '.top', function(){
$('html, body').animate( { scrollTop: 0 }, 'slow' );
return false;
});
Leave a comment
Recent Snippets
- htaccess : Only allow access to specific wordpress upload types if logged in
- MySQL : Query WordPress Database for Invalid Media Filenames
- PHP : Get Actual IP Address with PHP
- JavaScript : Allow Tab in Textarea
- PHP : Clean sanitized database contents on output
- htaccess : Force www. prefix in URIs
- PHP : Force File Download with Correct Content Type
- Wordpress : Disable upgrade notification