Vorlage:Button
Aus BogenWiki
(Unterschied zwischen Versionen)
Nugman (Diskussion | Beiträge) |
Nugman (Diskussion | Beiträge) |
||
| Zeile 12: | Zeile 12: | ||
; Caption: Angeziegter Text auf dem Button | ; Caption: Angeziegter Text auf dem Button | ||
; ID: Eindeutige ID des Button | ; ID: Eindeutige ID des Button | ||
| - | ; | + | ; OnEvent: JavaScript-Funktion die bei den folgenden Events aufgerufen werden soll: |
| + | : :onclick Parameter | ||
|} | |} | ||
| - | {{Button|Caption=Test-Button|ID=TestBtn|onclick= | + | {{Button|Caption=Test-Button 1|ID=TestBtn|onclick=TestBtnEvent}} |
| + | {{Button|Caption=Test-Button 2|ID=TestBtn|onclick=TestBtnEvent}} | ||
<html><script type="text/javascript"> | <html><script type="text/javascript"> | ||
| - | function | + | sActiveBtnID = ''; |
| + | sInActiveColor = ''; | ||
| + | function TestBtnEvent(sID,sEvent,sDefaultColor) { | ||
alert('Button "'+sID+'" angeklickt !!!'); | alert('Button "'+sID+'" angeklickt !!!'); | ||
| + | bBtnActive = false; | ||
| + | if (sID == sActiveBtnID) | ||
| + | bBtnActive = true; | ||
| + | elsif (sEvent == 'onmouseenter') | ||
| + | bBtnActive = true; | ||
| + | elsif (sEvent == 'onmouseleave') | ||
| + | bBtnActive = false; | ||
| + | elsif (sEvent == 'onclick') | ||
| + | bBtnActive = true; | ||
| + | elsif (sEvent == 'onload') | ||
| + | sInActiveColor = sDefaultColor; | ||
| + | |||
| + | this.style.background='#707070'; | ||
| + | this.style.color='white'; | ||
} | } | ||
</script></html> | </script></html> | ||
</noinclude><includeonly><nowiki | </noinclude><includeonly><nowiki | ||
| - | /><html><div id="</html>{{{ID}}}<html>" onclick="</html>{{{onclick}}}<html>('</html>{{{ID}}}<html>')" onmouseenter=" | + | /><html><div id="</html>{{{ID}}}<html>" onload="" onclick="</html>{{{onclick}}}<html>('</html>{{{ID}}}<html>')" onmouseenter="" onmouseleave="this.style.background='#E0E0E0';this.style.color='black';" style="display:inline-block;padding:4px 8px 3px 8px;background:#E0E0E0;border:solid #D0D0D0 1px;color:black;cursor:pointer;"><b></html>{{{Caption}}}<html></b></div></html><nowiki |
/></includeonly> | /></includeonly> | ||
Version vom 18:54, 15. Nov. 2021
| Name: | Button |
| Beschreibung: | Erzeugt einen Button ... |
| Parameter: |
|
Test-Button 1
Test-Button 2
