MediaWiki:Common.js: Difference between revisions

From Fabulous Loop de Loop
No edit summary
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


let test = document.getElementById("n-The-Fabulous-Loop-de-Loop");
let test = document.getElementById("n-Chapter-Outline");


// This handler will be executed only once when the cursor
// This handler will be executed only once when the cursor

Revision as of 08:02, 12 June 2021

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

let test = document.getElementById("n-Chapter-Outline");

// This handler will be executed only once when the cursor
// moves over the unordered list
test.addEventListener("mouseenter", function( event ) {
  // highlight the mouseenter target
  event.target.style.color = "white";

  // reset the color after a short delay
  setTimeout(function() {
    event.target.style.color = "";
  }, 500);
}, false);

// This handler will be executed every time the cursor
// is moved over a different list item
test.addEventListener("mouseover", function( event ) {
  // highlight the mouseover target
  event.target.style.color = "black";

  // reset the color after a short delay
  setTimeout(function() {
    event.target.style.color = "";
  }, 500);
}, false);