Scroll table cell content if user hovers with mouse

Discussion in 'Javascript' started by Pavils Jurjans, Jan 16, 2004.

  1. Hallo,

    Here's the behaviour I'm trying to get:

    I have a table with fixed column widths, and a single text line height
    for every row. In rare cases, some cells might contain text that is
    too long to fit within the cell box. To avoid text wrapping, I use
    <nobr> tags to ensure that text stays in one line. Here's the testing
    html:

    <table style="table-layout:fixed" border="1">
    <tr>
    <td width="200" onmouseover="cellMouseOver(event, this)"><nobr>
    So, here is some text that obviously will not fit in this lousy 200
    pixel wide box. Let's try to scroll it, if user hovers his mouse for
    some time over here.
    </nobr></td>
    </tr>
    </table>

    Now, what I am willing to do, is to program the cellMouseOver handler
    so that if user holds mouse over the cell for, say, 1 second, and if
    the text contents do not fit within the visible range of cell, it
    starts scrolling until reaches the end, and then bounces back.

    Well, all this timing handling etc. I can do easily, and the only
    thing that puzzles me is how to get that inner text being hide under
    the left side. I tried out scrollLeft prpoerty of table cell, negative
    margin/padding values for cell style, some more attempts, but noluck.
    I seem to be missing some elementary bit of knowledge to complish
    this.

    Please, if someone could suggest how to do this... I promise to post
    the final code in the group, I think that's a valuable functionality.

    Thanks,

    -- Pavils
    Pavils Jurjans, Jan 16, 2004
    #1
    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. Davisro
    Replies:
    2
    Views:
    1,308
    Jim Corey
    Apr 23, 2004
  2. nicholas
    Replies:
    0
    Views:
    440
    nicholas
    Dec 7, 2004
  3. Replies:
    6
    Views:
    536
  4. Replies:
    6
    Views:
    4,911
  5. Tim Streater
    Replies:
    2
    Views:
    151
    dorayme
    Apr 23, 2014
Loading...

Share This Page