MediaWiki:Common.js: Difference between revisions
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. */ | ||
/* ====== switch toggle ====== */ | |||
document.getElementById('switch-input').addEventListener('click', toggleView); | |||
var toggleStatus = 'no'; | var toggleStatus = 'no'; | ||
Revision as of 11:16, 12 May 2024
/* Any JavaScript here will be loaded for all users on every page load. */
/* ====== switch toggle ====== */
document.getElementById('switch-input').addEventListener('click', toggleView);
var toggleStatus = 'no';
function toggleView() {
if (toggleStatus == 'no') {
document.getElementById('slider').classList.add("slider-alt");
toggleStatus = 'yes';
} else {
document.getElementById('slider').classList.remove("slider-alt");
toggleStatus = 'no';
}
}