Hallo,
ich interessiere mich für die languageMenu.php. Die Übergabe der Sprachen dort ist recht simple. Allerdings würde ich gerne einen OnMouseOver/Out-Effekt einbauen wollen.
flag_indo.gif = normale Fahne
flag_indo_g.gif = grün hinterlegt - nur wenn inaktiv
Der Standardcode im LanguageMenu.php sieht ja wie folgt aus:
$flags[] = ($GLOBALS['TSFE']->sys_language_uid==7?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=1').'" target="_top"><img src="typo3/sysext/cms/tslib/media/uploads/flag_dk'.($langArr[1]?'':'_d').'.gif" width="21" height="13" hspace="5" border="0" alt="" /></a>';
Habe in anderen Foren mal geschaut, wie man diesen MouseOver-Effekt in PHP codieren kann:
1. Möglichkeit
Link: CMSimple Support Forum :: View topic - languagemenu
onmouseover="image1.src=''.$pth['folder']['flags'].$cf['language']['default'].'.jpg'"
onmouseout="image1.src=''.$pth['folder']['flags'].$cf['language']['default'].'.gif'"
2. Möglichkeit
Link: [url=http://www.php-resource.de/forum/showthread/t-49532.html]PHP script resource
Brauch Hilfe: Button wechsel[/url]
[code language=php]
<a href="index.php" onmouseover="image2.src='nav_startseite2.gif';" onmouseout="image2.src='nav_startseite.gif';">
<img name="image2" src="nav_startseite.gif" border="0" width="120" height="15" alt="" /></a>[/code]
Transformiert würde das so aussehen:
1. Möglichkeit
[code language=php]$flags[] = ($GLOBALS['TSFE']->sys_language_uid==8?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=2').'"
target="_top"onmouseover="image1.src='fileadmin/.../flag_indo'.$pth['folder']['flag'].$cf['language']['default'].'.gif'" onmouseout="image1.src=''.$pth['fileadmin/.../']['flag_indo_g'].$cf['language']['default'].'.gif'"><img src="fileadmin/.../flag_indo.gif" width="21" height="13" hspace="5" border="0" alt="" /></a>';[/code]
oder so (vielleicht habe ich's in den falschen Bereich geschrieben)
[code language=php]$flags[] = ($GLOBALS['TSFE']->sys_language_uid==8?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=2').'"
target="_top"onmouseover="image1.src=''.$pth['fileadmin/.../']['flag_indo'].$cf['language']['default'].'.gif'" onmouseout="image1.src=''.$pth['fileadmin/.../']['flag_indo_g'].$cf['language']['default'].'.gif'"><img src="fileadmin/.../flag_indo.gif" width="21" height="13" hspace="5" border="0" alt="" /></a>';[/code]
2. Möglichkeit
[code language=php]
$flags[] = ($GLOBALS['TSFE']->sys_language_uid==8?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']-">id.'&L=2').'" target="_top" onMouseOver="image2.src='fileadmin/.../flag_indo.gif';"
onMouseOut="image2.src='fileadmin/.../flag_indo.gif';">
<img name="image2" src="fileadmin/.../flag_indo.gif" border="0" width="120" height="15" alt="" /><img src="fileadmin/.../flag_indo.gif" width="21" height="13" hspace="5" border="0" alt="" /></a>';[/code]
Allerdings funktioniert das ALLES nicht! Könnt Ihr mir helfen und sagen, wie man diesen Effekt richtig programmiert??
Gruß