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

Line 180: Line 180:
 
</div>
 
</div>
  
 +
<script type="text/javascript">
 +
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:-90px;width:100%;"
 +
    } else {
 +
        oDiv.style = ""
 +
    }
 +
    }
 +
}
 +
</script>
  
 
</html>
 
</html>

Revision as of 15:48, 30 October 2017