MediaWiki:Vector.js: Difference between revisions
From EPOD
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
else if (document.body)//ie quirks | else if (document.body)//ie quirks | ||
vertical_position = document.body.scrollTop; | vertical_position = document.body.scrollTop; | ||
document.getElementById('mw-page-base').style.top = (vertical_position) + 'px'; | //document.getElementById('mw-page-base').style.top = (vertical_position) + 'px'; | ||
document.getElementById('mw-head').style.top = (vertical_position) + 'px'; | //document.getElementById('mw-head').style.top = (vertical_position) + 'px'; | ||
document.getElementById('mw-panel').style.top = (vertical_position + 160) + 'px'; | document.getElementById('mw-panel').style.top = (vertical_position + 160) + 'px'; | ||
} | } |
Revision as of 16:25, 2 May 2019
/* Any JavaScript here will be loaded for users using the Vector 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('mw-page-base').style.top = (vertical_position) + 'px';
//document.getElementById('mw-head').style.top = (vertical_position) + 'px';
document.getElementById('mw-panel').style.top = (vertical_position + 160) + 'px';
}