Line 1: | Line 1: | ||
<html> | <html> | ||
− | + | <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> | |
+ | <script> | ||
+ | $(document).ready(function () { | ||
+ | $(window).scroll(function () { | ||
+ | if ($(this).scrollTop() > 100) { | ||
+ | $('.up').fadeIn(); | ||
+ | } else { | ||
+ | $('.up').fadeOut(); | ||
+ | } | ||
+ | }); | ||
+ | $('.scrollup').click(function () { | ||
+ | $("html, body").animate({ | ||
+ | scrollTop: 0 | ||
+ | }, 600); | ||
+ | return false; | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
<body> | <body> | ||
Revision as of 13:25, 9 September 2016