Template:Team:SCUT/mainhead
From 2014.igem.org
(Difference between revisions)
Line 134: | Line 134: | ||
li#safety{width:43px;} | li#safety{width:43px;} | ||
- | #left{ | + | #left{position:absolute;top:0px;width:200px;height:800px;z-index:1000;} |
.navihead{width:200px;height:45px;font-size:20px;} | .navihead{width:200px;height:45px;font-size:20px;} | ||
.navihead img{width:200px;height:auto;} | .navihead img{width:200px;height:auto;} | ||
Line 140: | Line 140: | ||
#show{display:block;} | #show{display:block;} | ||
.navibody p{margin:20px;line-height:30px;} | .navibody p{margin:20px;line-height:30px;} | ||
- | |||
Line 261: | Line 260: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
var element = $("#left"); | var element = $("#left"); | ||
- | var | + | var top = element.position().top + 150; |
var pos = element.css("position"); | var pos = element.css("position"); | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
var scrolls = $(this).scrollTop() + 150; | var scrolls = $(this).scrollTop() + 150; | ||
- | if(scrolls > | + | if(scrolls > top) |
{ | { | ||
- | element.css({"position":"fixed"," | + | element.css({"position":"fixed","top":"150px"}); |
} | } | ||
else | else | ||
{ | { | ||
- | element.css({"position": | + | element.css({"position":pos,"top":"0px"}); |
} | } | ||
}); | }); | ||
Line 277: | Line 276: | ||
}); | }); | ||
</script> | </script> | ||
+ | |||
</BODY> | </BODY> | ||
</HTML> | </HTML> |
Revision as of 06:26, 9 October 2014