Difference between revisions of "Template:Sicau-china navigation"

Line 94: Line 94:
  
 
     <!--- THIS IS WHERE THE HTML BEGINS --->
 
     <!--- THIS IS WHERE THE HTML BEGINS --->
<div>
+
<div id="float">
 
<img src="https://static.igem.org/mediawiki/2017/3/3e/T-SICAU-navigation_background-image.jpg" class="navigationimage" />
 
<img src="https://static.igem.org/mediawiki/2017/3/3e/T-SICAU-navigation_background-image.jpg" class="navigationimage" />
 
<div class="navigation">
 
<div class="navigation">
Line 134: Line 134:
 
</div>
 
</div>
  
<script>
 
window.onload=
 
function(){
 
    var oDiv = document.getElementById("float"),
 
H = 0,
 
Y = oDiv
 
while (Y) {H += Y.offsetTop; Y = Y.offsetParent}
 
window.onscroll = function()
 
{
 
    var s = document.body.scrollTop || document.documentElement.scrollTop
 
    if(s>H) {
 
        oDiv.style = "position:fixed;top:0;width:100%;"
 
    } else {
 
        oDiv.style = ""
 
    }
 
    }
 
}
 
</script>
 
  
 
</html>
 
</html>

Revision as of 10:36, 10 October 2017