Jump to content

User:Gerbrant/hidePane.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gerbrant (talk | contribs) at 15:03, 17 November 2006 (so perhaps that was superfluous). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
document.write("<style>\
.portlet\
{\
	width:2em\
}\
#content\
{\
	margin-left:2em!important\
}\
#column-one\
{\
	padding-top:3em!important\
}\
.portlet .pBody\
{\
	width:10em!important;\
}\
.portlet ul\
{\
	margin-left:0!important\
}\
#p-logo\
{\
	display:none\
}\
#p-cactions\
{\
	left:2em!important\
}\
</style>");

addOnloadHook(function()
{
	var l = [];

	function doPortlet(e)
	{
		e.onmouseover = function()
		{
			e.style.width="12em";
			window.event.cancelBubble=true;
		};
		l.push(e);
	}

	function hidePortlets()
	{
		var e;
		for(e in l) l[e].style.width="";
	}

	document.body.onmouseover = hidePortlets;

	doPortlet(document.getElementById("p-navigation"));
	doPortlet(document.getElementById("p-search"));
	doPortlet(document.getElementById("p-tb"));
});