Skywalkerest (Talk | contribs) |
Skywalkerest (Talk | contribs) |
||
Line 501: | Line 501: | ||
</script> | </script> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<style> | <style> | ||
− | + | #background{ | |
− | + | ||
− | + | ||
position:fixed; | position:fixed; | ||
min-width: 1024px; | min-width: 1024px; | ||
Line 564: | Line 536: | ||
height: 80px; | height: 80px; | ||
margin:30px 0 0 160px; | margin:30px 0 0 160px; | ||
− | line-height:25px | + | line-height:25px |
} | } | ||
#button_wrapper{ | #button_wrapper{ | ||
Line 637: | Line 609: | ||
</style> | </style> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | $(function(){ | ||
+ | $("#top_btn").fadeOut(500); | ||
+ | $(window).scroll(function(){ | ||
+ | var w_height = $(window).height(); | ||
+ | var scroll_top = $(document).scrollTop(); | ||
+ | if(scroll_top > w_height){ | ||
+ | $("#top_btn").fadeIn(500); | ||
+ | }else{ | ||
+ | $("#top_btn").fadeOut(500); | ||
+ | } | ||
+ | }); | ||
+ | $("#top_btn").click(function(e){ | ||
+ | e.preventDefault(); | ||
+ | $(document.documentElement).animate({ | ||
+ | scrollTop: 0 | ||
+ | },200); | ||
+ | $(document.body).animate({ | ||
+ | scrollTop: 0 | ||
+ | },200); | ||
+ | }); | ||
+ | }) | ||
+ | </script> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
</html> | </html> |
Revision as of 06:49, 23 October 2017