Difference between revisions of "MediaWiki:Gadget-TimelessSidebarDropdowns.js"
From Nookipedia, the Animal Crossing wiki
SuperHamster (talk | contribs) (Starting gadget to enable dropdowns in Timeless sidebar, in alpha) |
SuperHamster (talk | contribs) (Only applying to main site nav) |
||
Line 5: | Line 5: | ||
} | } | ||
− | $('.sidebar-inner .mw-portlet:not(#p-navigation)').on("mouseover", function () { | + | $('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)').on("mouseover", function () { |
$(this).children('.mw-portlet-body')[0].style.display = 'block'; | $(this).children('.mw-portlet-body')[0].style.display = 'block'; | ||
}); | }); | ||
− | $($('.sidebar-inner .mw-portlet:not(#p-navigation)'), $('.sidebar-inner .mw-portlet:not(#p-navigation)').children('.mw-portlet-body')[0]).on("mouseleave", function () { | + | $($('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)'), $('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)').children('.mw-portlet-body')[0]).on("mouseleave", function () { |
timer = setTimeout(hide($(this)), 10); | timer = setTimeout(hide($(this)), 10); | ||
}).mouseenter(function() { | }).mouseenter(function() { | ||
clearTimeout(timer); | clearTimeout(timer); | ||
}); | }); |
Revision as of 03:12, August 29, 2021
var timer;
function hide(element) {
$(element).children('.mw-portlet-body')[0].style.display = "none"
}
$('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)').on("mouseover", function () {
$(this).children('.mw-portlet-body')[0].style.display = 'block';
});
$($('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)'), $('#site-navigation .sidebar-inner .mw-portlet:not(#p-navigation)').children('.mw-portlet-body')[0]).on("mouseleave", function () {
timer = setTimeout(hide($(this)), 10);
}).mouseenter(function() {
clearTimeout(timer);
});