onmouseover and onmouseout does not work

Discussion in 'HTML' started by Kurda Yon, Feb 10, 2008.

  1. Kurda Yon

    Kurda Yon Guest

    Hi,

    I try to create a table of images (images of the same size are put in
    a table with fixed number of rows and columns). Moreover, I want image
    changes if mouse is no the image. This code works fine:

    <table border='0' cellpadding='0' cellspacing='10'><tr>
    <td>
    <div target="_blank" onmouseover="document.sub_but.src='img_tmp/
    706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
    <IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
    NAME="sub_but">
    </div>
    </td>
    <td>
    </td>
    </tr></table>

    However, if I add an image to the second <td></td>-element, the images
    (both) does not want to change if the mous is over. So the following
    code does not work:

    <table border='0' cellpadding='0' cellspacing='10'><tr>
    <td>
    <div target="_blank" onmouseover="document.sub_but.src='img_tmp/
    706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
    <IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
    NAME="sub_but">
    </div>
    </td>
    <td>
    <div target="_blank" onmouseover="document.sub_but.src='img_tmp/
    706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
    <IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
    NAME="sub_but">
    </div>
    </td>
    </tr></table>

    What is the reason of this behavior and how I can reach my goal?

    Thank you.
    Kurda Yon, Feb 10, 2008
    #1
    1. Advertising

  2. Kurda Yon

    Andy Dingley Guest

    On 10 Feb, 02:00, Kurda Yon <> wrote:

    > how I can reach my goal?


    You start by posting a URL, so that we can see it in action.
    Andy Dingley, Feb 10, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tor Inge Rislaa
    Replies:
    3
    Views:
    16,122
    Jerry III
    Aug 6, 2003
  2. Dave
    Replies:
    0
    Views:
    466
  3. yawnmoth
    Replies:
    4
    Views:
    225
    yawnmoth
    Dec 8, 2004
  4. Epetruk

    onMouseOver/onMouseOut not working

    Epetruk, Feb 13, 2005, in forum: Javascript
    Replies:
    12
    Views:
    363
  5. Steve Macleod
    Replies:
    2
    Views:
    147
    Steve Macleod
    May 20, 2006
Loading...

Share This Page