MediaWiki:Vector.js: Difference between revisions

From EPOD
(Created page with "→‎Any JavaScript here will be loaded for users using the Vector skin: window.onscroll = function (e) { var vertical_position = 0; if (pageYOffset)//usual vertical_pos...")
 
m (Minor correction)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for users using the Vector skin */
/* Any JavaScript here will be loaded for users using the Vector skin */


window.onscroll = function (e) {
window.onload = function (e) {
  var vertical_position = 0;
   document.getElementById('mw-panel').style.position='fixed';
  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-head').style.top = (vertical_position) + 'px';
   document.getElementById('mw-panel').style.top = (vertical_position + 160) + 'px';
}
}

Latest revision as of 17:40, 28 February 2020

/* Any JavaScript here will be loaded for users using the Vector skin */

window.onload = function (e) {
  document.getElementById('mw-panel').style.position='fixed';
}