SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onmouseover event?

    Dear All,
    Here is the code,
    please look at this,

    <html>
    <head></head>
    <style>
    #sampleDIV {
    position: absolute;
    background: transparent;
    top: 10px;
    left: 45px;
    border: 2px solid #F00;
    width:67px;
    height:23px;
    }
    </style>
    <body>
    <div id="sampleDIV"></div>
    <table border="2px">
    <tr>
    <td>test1</td>
    <td onmouseover="alert('hi')">test2</td>
    <td onmouseover="alert('hi')">test3</td>
    </tr>
    <tr>
    <td>test4</td>
    <td>test5</td>
    <td>test6</td>
    </tr>
    </table>
    </body>
    </html>

    Here, the event "onmouseover" of td doesn't get fired?
    The "sampleDIV" must be in its place.
    Is there any other method to fire this event without changing the "sampleDIV"'s position.


    Thanks,
    Suresh.

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The positioned element (div) is in front of the unpositioned table, always.
    You can never reach the table with a mouse event.

    You can do a couple things:

    Rewrite the first line in the stylesheet to position the table absolutely:
    #sampleDIV ,table{

    Or write a line setting the table position and z-index:
    table{position:relative;z-index:2}

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi mrhoo,
    thanks for your reply.
    It worked for me.

    Thank you very much,

    Regards,
    Suresh.


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
  •