Only shows the logo and main menu on mouse-over on the grey top bar. (The initial collapse is instantaneous, whether it should be animated or not may be a matter of preference.)
// ==UserScript==
// @name Collapse Headers
// @namespace stackoverflow
// @include *stackoverflow.com*
// ==/UserScript==
(function ()
{
GM_addStyle("#header { height: 0px; }");
var cancelWaiting = false;
jq_wait();
function jq_wait()
{
if (typeof unsafeWindow.jQuery == 'undefined')
{
window.setTimeout(jq_wait, 100);
} else
{
$ = unsafeWindow.jQuery;
window.setTimeout(function () { cancelWaiting = true; }, 5000);
$(document).ready(header_wait);
}
}
function header_wait()
{
var itemstopbar = $("#header"".topbar");
if (itemstopbar.length == 0)
{
if (cancelWaiting) return;
window.setTimeout(header_wait, 10);
}
else
{
itemsvar header = $("#header");
header.css("overflow", "hidden");
itemstopbar.mouseenter(function ()
{
itemsheader.stop();
itemsheader.animate({ height: "120px" }, 500);
});
itemstopbar.mouseleave(function ()
{
itemsheader.stop();
itemsheader.animate({ height: "38px""0px" }, 500);
});
items.css("height", "38px");
}
}
})();
- Changed expand/collapse logic to not allow endless queuing.
Issues:
- The2013/12/05
overflow:hidden
cuts off a part of- Updated script to work accordingly for the StackExchange™ MultiCollider SuperDropdown™, most visible when there are new messages in the inboxtop bar.