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. Advertisements

  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. Advertisements

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,434
    Jerry III
    Aug 6, 2003
  2. Robson Carvalho Machado

    Setting onMouseOver and onMouseOut on dynamic objects

    Robson Carvalho Machado, Aug 18, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    347
    Robson Carvalho Machado
    Aug 19, 2004
  3. Shawn Windle

    onMouseover and onMouseout problems

    Shawn Windle, Sep 1, 2003, in forum: Javascript
    Replies:
    0
    Views:
    156
    Shawn Windle
    Sep 1, 2003
  4. Samir

    onmouseover and onmouseout event

    Samir, Nov 3, 2004, in forum: Javascript
    Replies:
    7
    Views:
    427
    Zifud
    Nov 5, 2004
  5. yawnmoth
    Replies:
    4
    Views:
    355
    yawnmoth
    Dec 8, 2004
  6. Epetruk

    onMouseOver/onMouseOut not working

    Epetruk, Feb 13, 2005, in forum: Javascript
    Replies:
    12
    Views:
    626
  7. Steve Macleod
    Replies:
    2
    Views:
    268
    Steve Macleod
    May 20, 2006
  8. Daz
    Replies:
    2
    Views:
    252
Loading...