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; top:550px; right:75px; cursor:pointer; position:fixed;">
+
<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>  
+
</div>  
-
<div id="gototop_2" style="width:60px; top:550px; right:75px; cursor:pointer; position:fixed;">
+
-
      <img src="https://static.igem.org/mediawiki/2014/a/ae/Xmu_up_UFO_zwei.png" width="150%" height="150%"/>
+
-
</div>
+
-
<div id="gototop_3" style="width:60px; top:550px; right:75px; cursor:pointer; position:fixed;">
+
-
      <img src="https://static.igem.org/mediawiki/2014/a/a2/Xmu_down_UFO_zwei.png" width="150%" height="150%"/>
+
-
</div>
+
<!--鼠标移入移出图标变化-->
<!--鼠标移入移出图标变化-->
<script type="text/javascript">
<script type="text/javascript">
-
$("#gototop_2").hide();
+
$(document).ready(function(){
-
$("#gototop_3").hide();
+
$("#gototop").mouseenter(function(){
$("#gototop").mouseenter(function(){
-
$("#gototop").hide();
+
$("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/ae/Xmu_up_UFO_zwei.png");
-
$("#gototop_2").show();
+
$("#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").hide();
+
$("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/a2/Xmu_down_UFO_zwei.png");
-
$("#gototop_2").hide();
+
-
$("#gototop_3").show();
+
}
}
         else  {
         else  {
-
$("#gototop").hide();
+
$("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/a/ae/Xmu_up_UFO_zwei.png");
-
$("#gototop_3").hide();
+
-
$("#gototop_2").show();
+
}
}
         lastScrollY = diffY;
         lastScrollY = diffY;
$("#gototop").animate({padding: "+=0px"},600,function(){
$("#gototop").animate({padding: "+=0px"},600,function(){
-
$("#gototop_3").hide();
+
$("#gototop img").attr("src","https://static.igem.org/mediawiki/2014/b/bd/Xmu_stop_UFO.png");
-
$("#gototop_2").hide();
+
-
$("#gototop").show();
+
});
});
});
});
Line 47: Line 37:
<!--图标回到顶页-->
<!--图标回到顶页-->
<script type="text/javascript">  
<script type="text/javascript">  
-
    $("#gototop_2").click(function(){
+
    $("#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