MediaWiki:Beichtomat.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
WiMu (Diskussion | Beiträge) K (mal gucken ... viel isses noch nicht) |
WiMu (Diskussion | Beiträge) K (mal ein bischen mehr script ... wenn's nicht läuft, weiß ich schon woran's liegen tut ...) |
||
Zeile 1: | Zeile 1: | ||
window.onload = function() | window.onload = function() | ||
{ | { | ||
− | document.getElementById("insertadditionalhtml0").innerHTML = '<center><div class="handbutton" onclick="step1 | + | document.getElementById("insertadditionalhtml0").innerHTML = '<center><div class="handbutton" onclick="skipcontent(' + "'step0', 'step1'" + ')"><div class="text" onclick="step1()">Beichte starten</div></div></center>'; |
− | } | + | }; |
− | function step1() | + | //*function step1() |
+ | //* { | ||
+ | //* document.getElementsByTagName("h1")[0].innerHTML = document.getElementsByTagName("h1")[0].innerHTML + " online – mit dem Beichtomat™ v1.0 (beta)"; | ||
+ | //* document.getElementById("beichte").style.padding = '10px'; | ||
+ | //* document.getElementById("beichte").innerHTML = 'so weit bin ich noch nicht ... erstmal bei mir zuhause zum Laufen kriegen'; | ||
+ | //* } | ||
+ | |||
+ | var resizespeed = 5; | ||
+ | |||
+ | function reduceheight(page) | ||
+ | { | ||
+ | currentheight = document.getElementById(page).offsetHeight; | ||
+ | if(currentheight - resizespeed >= 0) | ||
+ | { | ||
+ | document.getElementById(page).style.height = currentheight - resizespeed + "px"; | ||
+ | } else { | ||
+ | document.getElementById(page).style.height = "0px"; | ||
+ | document.getElementById(page).style.display = "none"; | ||
+ | return "invisible"; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | function enlargeheight(page) | ||
+ | { | ||
+ | if (document.getElementById(page).style.display == "none") | ||
+ | { | ||
+ | document.getElementById(page).style.display = ""; | ||
+ | }; | ||
+ | if (document.getElementById(page).offsetHeight > document.getElementById(page + "inner").offsetHeight) | ||
+ | { | ||
+ | document.getElementById(page).style.height = ""; | ||
+ | return "visible"; | ||
+ | } else { | ||
+ | currentheight = document.getElementById(page).offsetHeight; | ||
+ | document.getElementById(page).style.height = currentheight + resizespeed + "px"; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | function hidecontent(page) | ||
+ | { | ||
+ | if (reduceheight(page) != "invisible") | ||
+ | { | ||
+ | reduceheight(page); | ||
+ | setTimeout('hidecontent("' + page + '")', 1); | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | function showcontent(page) | ||
+ | { | ||
+ | if (enlargeheight(page) != "visible") | ||
+ | { | ||
+ | enlargeheight(page); | ||
+ | setTimeout('showcontent("' + page + '")', 1); | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | function skipcontent(page1, page2) | ||
{ | { | ||
− | + | if (reduceheight(page1) + enlargeheight(page2) != "invisiblevisible") | |
− | + | { | |
− | + | reduceheight(page1); | |
− | } | + | enlargeheight(page2); |
+ | setTimeout('skipcontent("' + page1 + '", "' + page2 + '")', 1); | ||
+ | }; | ||
+ | }; |
Version vom 25. September 2008, 18:17 Uhr
window.onload = function()
{
document.getElementById("insertadditionalhtml0").innerHTML = '<center><div class="handbutton" onclick="skipcontent(' + "'step0', 'step1'" + ')"><div class="text" onclick="step1()">Beichte starten</div></div></center>';
};
//*function step1()
//* {
//* document.getElementsByTagName("h1")[0].innerHTML = document.getElementsByTagName("h1")[0].innerHTML + " online – mit dem Beichtomat™ v1.0 (beta)";
//* document.getElementById("beichte").style.padding = '10px';
//* document.getElementById("beichte").innerHTML = 'so weit bin ich noch nicht ... erstmal bei mir zuhause zum Laufen kriegen';
//* }
var resizespeed = 5;
function reduceheight(page)
{
currentheight = document.getElementById(page).offsetHeight;
if(currentheight - resizespeed >= 0)
{
document.getElementById(page).style.height = currentheight - resizespeed + "px";
} else {
document.getElementById(page).style.height = "0px";
document.getElementById(page).style.display = "none";
return "invisible";
};
};
function enlargeheight(page)
{
if (document.getElementById(page).style.display == "none")
{
document.getElementById(page).style.display = "";
};
if (document.getElementById(page).offsetHeight > document.getElementById(page + "inner").offsetHeight)
{
document.getElementById(page).style.height = "";
return "visible";
} else {
currentheight = document.getElementById(page).offsetHeight;
document.getElementById(page).style.height = currentheight + resizespeed + "px";
};
};
function hidecontent(page)
{
if (reduceheight(page) != "invisible")
{
reduceheight(page);
setTimeout('hidecontent("' + page + '")', 1);
};
};
function showcontent(page)
{
if (enlargeheight(page) != "visible")
{
enlargeheight(page);
setTimeout('showcontent("' + page + '")', 1);
};
};
function skipcontent(page1, page2)
{
if (reduceheight(page1) + enlargeheight(page2) != "invisiblevisible")
{
reduceheight(page1);
enlargeheight(page2);
setTimeout('skipcontent("' + page1 + '", "' + page2 + '")', 1);
};
};