MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Matura Wiki
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
 +
/* Code für Section-Hide */
 +
 
function toggleSectionVisibility(fieldObj, id, txt1, txt2)
 
function toggleSectionVisibility(fieldObj, id, txt1, txt2)
 
   {
 
   {

Version vom 21. Juli 2015, 06:49 Uhr

/* Code für Section-Hide */

function toggleSectionVisibility(fieldObj, id, txt1, txt2)
  {
  var e = document.getElementById('sectionblock'+id);
  if(txt1.search(/gif:/i) >= 0) txt1 = '<img src="'+txt1.replace(':', '">');
  if(txt2.search(/gif:/i) >= 0) txt2 = '<img src="'+txt2.replace(':', '">');
  if(fieldObj.innerHTML == txt1)
    {
    fieldObj.innerHTML = txt2;
    e.style.display = 'block';
    }
  else
    {
    fieldObj.innerHTML = txt1;
    e.style.display = 'none';
    }
  }