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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE Javascript events... onmouseout overwrites itself on the second call

    Hello everyone and thanks to the hosts at codingforums for making my question possible

    I am just trying to get the onmouseout event to work with my menu system, and I was wondering why, when you have two objects that do the same event, the first one gets cut off and stops doing what its doing. If anyone is interested, I will be glad to post my code that I have so far.

    I'm using:
    Internet Explorer 6
    Windows XP Pro

    If anyone needs any more info please let me know,
    and thank you in advance to anyone who can help me out ,

    C_elite

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    please post, I will be more than willing to assist. sounds like you have the same problem i encountered when i made my first menus. sounds to be a bubbling problem. look into stopping propagation.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <html>
    <head>

    <style>
    .tds
    {
    background-Color:'E1E1E1';
    width:100;
    height:20;
    text-align:center;
    border:0px solid gray;
    font-size:14;
    filter:alpha(opacity=85);
    -moz-opacity:45%;
    cursor:hand;
    }
    </style>

    <script language='javascript'>




    function change_color(obj_name, start, end_c)
    {
    i = 0;

    speed = 10;
    obj_char = obj_name;
    start_hex = start;
    end_hex = end_c;
    obj_hex = document.getElementById(obj_char);

    red_s = parseInt(start.charAt(0)+start.charAt(1), 16);
    red_e = parseInt(end_c.charAt(0)+end_c.charAt(1), 16);

    green_s = parseInt(start.charAt(2)+start.charAt(3), 16);
    green_e = parseInt(end_c.charAt(2)+end_c.charAt(3), 16);

    blue_s = parseInt(start.charAt(4)+start.charAt(5), 16);
    blue_e = parseInt(end_c.charAt(4)+end_c.charAt(5), 16);

    i = 0;
    if(red_s != red_e || green_s != green_e || blue_s != blue_e)
    {
    if(red_s < red_e-speed || red_s > red_e+speed)
    {
    if (red_s < red_e) { red_s = red_s + speed; }
    else { red_s = red_s - speed; }
    }
    if(green_s < green_e-speed || green_s > green_e+speed)
    {
    if (green_s < green_e) { green_s = green_s + speed; }
    else { green_s = green_s - speed; }
    }
    if(blue_s < blue_e-speed || blue_s > blue_e+speed)
    {
    if (blue_s < blue_e) { blue_s++; }
    else { blue_s--; }
    }

    if(red_s != red_e)
    {
    if (red_s < red_e) { red_s++; }
    else { red_s--; }
    }
    if(green_s != green_e)
    {
    if (green_s < green_e) { green_s++; }
    else { green_s--; }
    }
    if(blue_s != blue_e)
    {
    if (blue_s < blue_e) { blue_s++; }
    else { blue_s--; }
    }

    red_shift = red_s;
    green_shift = green_s;

    red_hex = red_shift.toString(16);
    if(red_hex.length == 1) { red_hex = "0" + red_hex; }
    green_hex = green_shift.toString(16);
    if(green_hex.length == 1) { green_hex = "0" + green_hex; }
    blue_hex = blue_s.toString(16);
    if(blue_hex.length == 1) { blue_hex = "0" + blue_hex; }

    color = red_hex + green_hex + blue_hex;
    color_hex = red_hex + green_hex + blue_hex;

    obj_hex.style.backgroundColor = color;
    setInterval("change_color(obj_char, color_hex, end_hex)", 0);
    }
    }

    </script>
    </head>

    <body>

    <table name=link_table id=link_table>
    <tr>
    <td id="home" name="home" class="tds" onmouseover="this.style.backgroundColor='highlight';" onmouseout="change_color('home', '0000ff', 'e1e1e1');" onclick="window.location='#';">Home</td>
    </tr>
    <tr>
    <td id="blah1" name="blah1" class="tds" onmouseover="this.style.backgroundColor='highlight';" onmouseout="change_color('blah1', '0000ff', 'e1e1e1');" onclick="window.location='#';">Blah</td>
    </tr>
    <tr>
    <td id="blah2" name="blah2" class="tds" onmouseover="this.style.backgroundColor='highlight';" onmouseout="change_color('blah2', '0000ff', 'e1e1e1');" onclick="window.location='#';">Blah</td>
    </tr>
    </table>

    </body>
    </html>


  •  

    Posting Permissions

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