MediaWiki:Templates.js

/* */

/* ============== ONMOUSEOVER TEMPLATES ==================== author:      Petr Kajzar User:Slepi date:        05/2009 license:     Wikilectures lf1.cuni.cz   =========================================================

// FUNCTION CHNAGING VISIBILITY OF THE TEMPLATE // after mouse over  // is displayed normally hidden element  function doHover { var hiddenMessage = getElementsByClass('hidden_message'); var hiddenMessageVis = getElementsByClass('hidden_message_visible'); var hiddenMessageHid = getElementsByClass('hidden_message_hidden');

// no hidden template -> exit if (hiddenMessage.length == 0) return;

// every element must have its own id for (i=0; i<hiddenMessage.length; i++) { hiddenMessage[i].id = "sch" + i;   hiddenMessageVis[i].id = "schVis" + i;    hiddenMessageHid[i].id = "schHid" + i;

viselem = "schVis" + i;   hidelem = "schHid" + i;

// show and hide element document.getElementById(hidelem).style.left = "-450px"; eval("document.getElementById('" + viselem + "').onmouseover = function{document.getElementById('" + hidelem + "').style.visibility = 'visible';};"); eval("document.getElementById('" + viselem + "').onmouseout = function{document.getElementById('" + hidelem + "').style.visibility = 'hidden';};"); } // end for }// end function

// start on page load addOnloadHook(doHover);

/* */