Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing colors (onmouseout prob)

    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!

  • #2
    New Coder
    Join Date
    Nov 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well you did put position: relativ, it should be position: relative... besides that i dont know.
    &#187; &#240;, Ŵħąŧ&#191; &#221;őų łįķę&#191;

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

    Code:
    <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>

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @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
    Last edited by FSME; 02-25-2003 at 02:54 AM.

  • #5
    New Coder
    Join Date
    Feb 2003
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx for the suggestion, but that didn't work either


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •