Results 1 to 2 of 2

Thread: javascript

  1. #1
    Join Date
    Dec 2004
    Location
    Colorado USA
    Posts
    11

    Default javascript

    im havin probs w/ the onmouseout event fer javascript
    heres the code (the site is goldencity.bizhat.com)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <title>The Golden City - Spreading His word, one person at a time</title>
    <style type="text/css">
    <!--
    body
     {
     scrollbarFaceColor:'green';
     }
    #hover
     {
     position:absolute;
     top:0px;
     visibility:hidden;
     }
     #norm
     {
     position:absolute;
     top:0px;
     }
    -->
    </style>
    <script language="JavaScript" type="text/javascript">
    map = new Array(0,4,68,71,171,174,341,344,441)
    function position()
     {
     var width=screen.width;
     var imgs;
     imgs="<img src=\"back.png\" style=\"position:absolute;top:0px;left:0px;width:"+width+";height:215;\"/>";
     imgs=imgs+"<img usemap=#a border=0 id=norm src=\"goldencity.png\" style=\"left:" + (width/2-233) + "px;\">";
     imgs=imgs+"<img usemap=#a border=0 onmouseout=\"mouseout()\" id=hover src=\"goldencity1.PNG\" style=\"left:" + (width/2-233) + "px;\">";
     return imgs;
     }
    function mouseover(a)
     {
     hover.style.clip="rect(154 "+map[a]+" 178 "+map[a-1]+")"
     hover.style.visibility='visible'
     }
     function mouseout()
     {
     hover.style.visibility='hidden'
     }
    </script>
    </head>
    <body>
    <script language="JavaScript" type="text/javascript">
    <!--
    document.write(position());
    //-->
    </script>
    <map name=a>
    <area shape=rect alt="Home" coords="4,154,68,178" onmouseover="mouseover(2)" href="http://goldencity.bizhat.com/">
    <area shape=rect alt="Sermons" coords="71,154,171,178" onmouseover="mouseover(4)" href="http://goldencity.bizhat.com/sermons">
    <area shape=rect alt="Spreadin' the Word" coords="174,154,341,178" onmouseover="mouseover(6)" href="http://goldencity.bizhat.com/hisword">
    <area shape=rect alt="Contact Us" coords="344,154,441,178" onmouseover="mouseover(8)" href="http://goldencity.bizhat.com/contact">
    </map>
    </body>
    </html>
    the point of this code is to clip a blue text image from goldencity1.png and put it on top of the same text on goldencity.png
    that works
    but when the mouse moves out of the clip, the mouseout event doesnt trigger
    it works on my comp, but not online

    help! :cry:

  2. #2
    Join Date
    Dec 2004
    Location
    Colorado USA
    Posts
    11

    Default

    nm, i fixed it
    i put the 'onmouseout="mouseout()"' after each <area> tag and it works now
    :)

Bookmarks

Posting Permissions

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