MediaWiki:Monobook.js: Difference between revisions
From EPOD
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
document.getElementById('p-logo').style.top = (vertical_position) + 'px'; | document.getElementById('p-logo').style.top = (vertical_position) + 'px'; | ||
document.getElementById('p-navigation').style.top = (vertical_position + 160) + 'px'; | document.getElementById('p-navigation').style.top = (vertical_position + 160) + 'px'; | ||
document.getElementById('p-navigation').style.position = 'absolute'; | |||
} | } |
Revision as of 11:02, 28 February 2017
/* Any JavaScript here will be loaded for users using the MonoBook skin */
window.onscroll = function (e) {
var vertical_position = 0;
if (pageYOffset)//usual
vertical_position = pageYOffset;
else if (document.documentElement.clientHeight)//ie
vertical_position = document.documentElement.scrollTop;
else if (document.body)//ie quirks
vertical_position = document.body.scrollTop;
document.getElementById('p-logo').style.top = (vertical_position) + 'px';
document.getElementById('p-navigation').style.top = (vertical_position + 160) + 'px';
document.getElementById('p-navigation').style.position = 'absolute';
}