MediaWiki:Monobook.js: Difference between revisions

From EPOD
(Created page with "→‎Any JavaScript here will be loaded for users using the MonoBook skin: window.onscroll = function (e) { var vertical_position = 0; if (pageYOffset)//usual vertical...")
 
No edit summary
Line 11: Line 11:
   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-head').style.top = (vertical_position) + 'px';
   document.getElementById('p-logo').style.top = (vertical_position) + 'px';
   document.getElementById('p-logo').style.top = (vertical_position + 160) + 'px';
   document.getElementById('p-navigation').style.top = (vertical_position + 160) + 'px';
}
}

Revision as of 11:01, 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';
}