SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    Nuneaton, UK
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mouseover changing table contents.

    Hi,

    I'm sure I've seen this before but I'm unsure where.

    What I want to do is, for example make a cell of a table to change its contents when the mouse rolls over a link. I want to use this to show a small picture and some text describing the link the mouse is currently on. Whats the best way about going about this?

    Thanks for the help

    Dolbz

  2. #2
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    moved to more appropriate forum...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  3. #3
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    use java or dhtml. i wrote somthing similar to this in 97 in java, showing some info in a layer when moving over a link. found it kinda annoying and removed it after a few weeks. look at dynamicdrive.com or other dhtml/java pages, im sure you find something.
    Who's to doom when the judge himself is dragged before the bar


  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A similar thread where I posted a demo of a dom solution that would suit your needs.
    http://www.sitepointforums.com/showt...hreadid=111866

    The demo

    Take a look at the page source and you'll see how simple it is by referencing innerHTML and src content.
    The innerHTML method isn't as modern as the preferred nodes method, but it is still acknowledged by the W3C and is equally if not more widely supported by browsers.

    ---

    Fwiw, I would strongly recommend against using Java*.
    I am just one of many, many people who have Java disabled by default. In my experience the effect/applet has never once been worth the risk/inevitabilty of having my browser crash.
    (* java ≠ javascript)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A method I used, which out the ones I have tried seems the best, is to create a scrolling division and within that create divisions for each rollover. make sure the contained divisions are the same height as the scrolling divisions. Then use
    Code:
    onmouseover="document.getElementById('scrollingDivision').style.scrollTop=n"
    If your scrollDivision is height:200px then each division is 200px lower from the next. To view the first n=0; the second n=200 and so on.

    I suggest leaving the scrollbars in view (overflow:scroll) and in JS check if Internet explorer; if it is apply document.getElementById('scrollingDivision').style.overflow="hidden" as IE will still scroll a division even without scrollbars. NS doesn't seem to. Check my site at www.unitingrhythms.co.uk, both my menu and my description box work using this method. And all text will be seen if JS has been turned of by the client.

    Hope it helps
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  6. #6
    SitePoint Member
    Join Date
    Jun 2003
    Location
    Nuneaton, UK
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    Fwiw, I would strongly recommend against using Java*.
    I am just one of many, many people who have Java disabled by default. In my experience the effect/applet has never once been worth the risk/inevitabilty of having my browser crash.
    (* java ≠ javascript)

    I totally agree, Java is the most ugly aspect of webdesign and should be avoided unless it is actually needed as far as I'm concerned.

    Also I think your method is simply and clean so I'm going for that. thanks!

    Dolbz

  7. #7
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    i was talking about javascript not java.. sorry my fault. i always forget the last letterz "script" well anyway Bill Posters solution is a great way of doing it.
    Who's to doom when the judge himself is dragged before the bar


  8. #8
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The changing of the innerHTML is a good method, I used it previously. But I wanted search engines to index the text to be shown, including any links that might be included. My scrolling method will look exactly the same, but the contents will be indexed by search engines.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


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
  •