Difference between revisions of "Template:FAFU CHINA/try"
Line 20: | Line 20: | ||
</head> | </head> | ||
+ | <body> | ||
+ | <!-- up --> | ||
+ | |||
+ | <a style="width:50px; height:50px; position:fixed; right:30px; bottom:30px; z-index:9999; display:none; background:url(https://static.igem.org/mediawiki/2015/c/c1/Amoy-Home_Up_pic.gif) no-repeat center center #147abc;" href="javascript:;" class="lanrenzhijia_top"></a> | ||
+ | |||
+ | <script> | ||
+ | $(function(){ | ||
+ | $(window).scroll(function(){ | ||
+ | var _top = $(window).scrollTop(); | ||
+ | if(_top>300){ | ||
+ | $('.lanrenzhijia_top').fadeIn(600); | ||
+ | }else{ | ||
+ | $('.lanrenzhijia_top').fadeOut(600); | ||
+ | } | ||
+ | }); | ||
+ | $(".lanrenzhijia_top").click(function(){ | ||
+ | $("html,body").animate({scrollTop:0},400); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | </body> | ||
</html> | </html> |
Revision as of 15:04, 16 September 2015