...

View Full Version : changing colors (onmouseout prob)



FSME
02-25-2003, 01:30 AM
Hi!

Im using the following functions:


<script language="JavaScript1.2">
function w(){dyntext.style.color='#FFFFFF';}
function g(){dyntext.style.color='#00FF00'}
function show(){dynwin.style.visibility='visible'; w()}
function hide(){dynwin.style.visibility='hidden'}
</script>



and this is how I call them:


<table border="0">
<tr>
<td align="center" width="50%"><a href="galerie2003.htm" onClick="hide()">| Zur Galerie |</a></td>
<td align="center" width="50%">
<div id="dyntext" style="position:relativ">
<font onClick="hide()" face="Tahoma" size="2" onMouseOver="g()" onMouseOut="w()"><b>|
Fenster schließen |</b>
</font>
</div></td></tr>
</table>


both codes are within the same html-file. strangely enough, it works locally but as soon as I upload it and test it, the w() method fails i.e. the call from within the show()-function does work but the onMouseOut="w()" doesn't.
I'm hoping for a spelling mistake again, but since it actually works here on my machine I'm quite confused...

Thanks a lot!

tempest1
02-25-2003, 01:39 AM
Well you did put position: relativ, it should be position: relative... besides that i dont know.

Skyzyx
02-25-2003, 01:46 AM
Well, I'm not entirely sure you can even call stuff like that and get away with it. Anyways, this is one way to do it so it works in all browsers... it should work anyways...



<script language="JavaScript1.2">

function w(){document.getElementById('dyntext').style.color='#FFFFFF';}
function g(){document.getElementById('dyntext').style.color='#00FF00';}
function show(){document.getElementById('dynwin').style.visibility='visible'; w();}
function hide(){document.getElementById('dynwin').style.visibility='hidden';}

</script>

*************************

<table border="0">
<tr>
<td align="center" width="50%"><a href="galerie2003.htm" onClick="hide()">| Zur Galerie |</a></td>
<td align="center" width="50%">
<div id="dyntext" style="position:relative;">
<font onClick="hide();" face="Tahoma" size="2" onMouseOver="g();" onMouseOut="w();"><b>| Fenster schließen |</b>
</font>
</div></td></tr>
</table>

FSME
02-25-2003, 01:46 AM
@tempest: that didn't change anything. actually: why DID it work, eventhough I misspelled it "relativ"? well, I guess it just ignored that part of the code and "relative" is the default value... hmm

@Skyzyx: using your code the w() function doesn't work at all, not even from within the show(). I have used the show and hide-functions until now (and they work fine) only the g() and w() parts are new. but the code should be ok, since the older functions work

thx, the both of you

Cris79
02-25-2003, 12:03 PM
I have test these scripts and a hava a sugestion:
use the second script but put in <a href="" onClick="hide()"> this ID="dynwin" and in body tag onload="w(); show()"
I hope this will work :D

FSME
02-26-2003, 12:18 PM
thx for the suggestion, but that didn't work either



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum