#1
  1. No Profile Picture
    Give peace a chance.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Buenos Aires, Argentina
    Posts
    83
    Rep Power
    14

    Unhappy how does it work in xhtml (javascript)


    I have this code for html (I'll copy just a part):
    <script>
    if (document.images){
    homeu= new Image();
    homeu.src="images/homeu.gif";
    }
    function Hover(ImageName){
    if(document.images){
    document[ImageName].src= eval(ImageName + "u.src");
    }
    }
    </script>
    <img src="images/homed.gif" class="button" name="home" alt="Home" onmouseover="Hover('home');">

    But I want to write it in xhtml where the name property doesn't exist, how do I write it ?
    Thank you
  2. #2
  3. No Profile Picture
    Bringer of the Bling
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Orlando, FL
    Posts
    68
    Rep Power
    14
    Code:
    <script>
    if (document.images){
    homeu= new Image();
    homeu.src="images/homeu.gif";
    }
    function Hover(ImageName){
    if(document.images){
    alert(document.getElementById(ImageName).src);
    document.getElementById(ImageName).src= eval(ImageName + "u.src");
    alert(document.getElementById(ImageName).src);
    }
    }
    </script>
    <img src="images/homed.gif" class="button" id="home" alt="Home" onmouseover="Hover('home');">

IMN logo majestic logo threadwatch logo seochat tools logo