Team:XMU-China/UFO
From 2014.igem.org
(Difference between revisions)
(Created page with "<html> <div id="gototop" style="width:60px; top:550px; right:75px; cursor:pointer; position:fixed;"> <img src="https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png" widt...") |
|||
Line 1: | Line 1: | ||
<html> | <html> | ||
- | + | <div id="gototop" style="width:60px; height:75px; bottom:50px; right:75px; cursor:pointer; position:fixed;"> | |
<img src="https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png" width="150%" height="150%"/> | <img src="https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png" width="150%" height="150%"/> | ||
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
<!--鼠标移入移出图标变化--> | <!--鼠标移入移出图标变化--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | + | $(document).ready(function(){ | |
- | + | ||
$("#gototop").mouseenter(function(){ | $("#gototop").mouseenter(function(){ | ||
- | $("#gototop"). | + | $("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/ae/Xmu_up_UFO_zwei.png"); |
- | $("# | + | $("#gototop").mouseleave(function(){ |
+ | $("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png"); | ||
+ | }); | ||
}); | }); | ||
+ | }); | ||
</script> | </script> | ||
Line 27: | Line 23: | ||
percent=diffY-lastScrollY; //获取滚动的百分比 | percent=diffY-lastScrollY; //获取滚动的百分比 | ||
if(percent>0) { | if(percent>0) { | ||
- | $("#gototop"). | + | $("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/a2/Xmu_down_UFO_zwei.png"); |
- | + | ||
- | + | ||
} | } | ||
else { | else { | ||
- | $("#gototop"). | + | $("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/ae/Xmu_up_UFO_zwei.png"); |
- | + | ||
- | + | ||
} | } | ||
lastScrollY = diffY; | lastScrollY = diffY; | ||
$("#gototop").animate({padding: "+=0px"},600,function(){ | $("#gototop").animate({padding: "+=0px"},600,function(){ | ||
- | $("# | + | $("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png"); |
- | + | ||
- | + | ||
}); | }); | ||
}); | }); | ||
Line 47: | Line 37: | ||
<!--图标回到顶页--> | <!--图标回到顶页--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $("# | + | $("#gototop").click(function(){ |
$('body,html').animate({scrollTop:0},500); | $('body,html').animate({scrollTop:0},500); | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 16:19, 16 October 2014