MediaWiki:Common.js: Difference between revisions

From wikilawschool.net. Wiki Law School does not provide legal advice. For educational purposes only.
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
$(document).scroll(function() {
$(document).scroll(function() {
   var y = $(this).scrollTop();
   var y = $(this).scrollTop();
   if (y > 800) {
   if (y < 800) {
     $('.skip-to-top-button').fadeIn();
     $('#skip-to-top-button').fadeOut();
   } else {
   } else {
     $('.skip-to-top-button').fadeOut();
     $('#skip-to-top-button').fadeIn();
   }
   }
});
});

Latest revision as of 02:41, June 1, 2020

/* Any JavaScript here will be loaded for all users on every page load. */

/* Enable Template:Skip to top button to fade out */
$(document).scroll(function() {
  var y = $(this).scrollTop();
  if (y < 800) {
    $('#skip-to-top-button').fadeOut();
  } else {
    $('#skip-to-top-button').fadeIn();
  }
});