The editors' meeting has been canceled for technical reasons.
MediaWiki:Vector.js: Difference between revisions
Jump to navigation
Jump to search
Created page with "→All JavaScript here will be loaded for users of the Vector skin: document.addEventListener('DOMContentLoaded', function() { // Example: Toggle sidebar visibility var toggleSidebar = document.createElement('button'); toggleSidebar.innerText = 'Menu'; toggleSidebar.style.position = 'fixed'; toggleSidebar.style.top = '10px'; toggleSidebar.style.left = '10px'; toggleSidebar.style.zIndex = 1000; toggleSidebar.addEventListener('click', fun..." |
No edit summary |
||
Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Vector skin */ | /* All JavaScript here will be loaded for users of the Vector skin */ | ||
document. | javascript | ||
// 创建移动端菜单按钮 | |||
$(document).ready(function() { | |||
if ($(window).width() <= 768) { | |||
$('body').prepend('<div id="mobile-menu-toggle">菜单</div>'); | |||
$('#mobile-menu-toggle').on('click', function() { | |||
$('body').toggleClass('menu-open'); | |||
}); | |||
} | |||
}); | |||
}); |
Revision as of 12:14, 25 October 2024
/* All JavaScript here will be loaded for users of the Vector skin */ javascript // 创建移动端菜单按钮 $(document).ready(function() { if ($(window).width() <= 768) { $('body').prepend('<div id="mobile-menu-toggle">菜单</div>'); $('#mobile-menu-toggle').on('click', function() { $('body').toggleClass('menu-open'); }); } });