Display image when mouseover on anchor

Discussion in 'HTML' started by Hvid Hat, Sep 22, 2008.

  1. Hvid Hat

    Hvid Hat Guest

    Hi

    I'd like to display an image when mouseover on an anchor. The image should be
    shown where the anchor is located and I don't want a popup window. It should
    also disappear once the mouse leaves the image.

    <a onmouseover="">move mouse here to see image</a>

    Is this possible? I've searched but I haven't found anything useful.
    Hvid Hat, Sep 22, 2008
    #1
    1. Advertising

  2. "Hvid Hat" <> writes:

    > I'd like to display an image when mouseover on an anchor. The image should be
    > shown where the anchor is located and I don't want a popup window. It should
    > also disappear once the mouse leaves the image.
    >
    > <a onmouseover="">move mouse here to see image</a>
    >
    > Is this possible?


    It's easy with JavaScript, but keep in mind that not everyone will
    allow that, so it's not a good idea to use it for anything that's
    required for your page to work. If the image is a non-essential
    convenience, like a thumbnail of the full-size image the link leads to
    or some such, go for it.

    sherm--

    --
    My blog: http://shermspace.blogspot.com
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Sherm Pendley, Sep 22, 2008
    #2
    1. Advertising

  3. Hvid Hat

    Hvid Hat Guest

    On 22-09-2008 22:34:45, Sherm Pendley wrote:
    > "Hvid Hat" <> writes:


    > It's easy with JavaScript, but keep in mind that not everyone will
    > allow that, so it's not a good idea to use it for anything that's
    > required for your page to work. If the image is a non-essential
    > convenience, like a thumbnail of the full-size image the link leads to
    > or some such, go for it.


    The image is non-essential. I've got a table of football players and as the
    last column I want an anchor that shows a player image on mouseover. I've
    been looking for a simple javascript solution without luck. I've been looking
    at Lightbox etc. but isn't that overkill?
    Hvid Hat, Sep 22, 2008
    #3
  4. Hvid Hat

    Roy A. Guest

    On 22 Sep, 22:22, "Hvid Hat" <> wrote:
    > Hi
    >
    > I'd like to display an image when mouseover on an anchor. The image should be
    > shown where the anchor is located and I don't want a popup window. It should
    > also disappear once the mouse leaves the image.
    >
    > <a onmouseover="">move mouse here to see image</a>


    The attribute onmouseover tells me that this is an javascript
    question. Pleas
    ask this kind of questions to a group like comp.lang.javascript or
    alt.comp.lang.­javascript.

    However, if JavaScript is disabled, you can use CSS.

    <a onmouseover="">move mouse here to see image<img ...></a>
    a img { position: absolute; visibility: hidden }
    a:hover img { visibility: visible }

    >
    > Is this possible? I've searched but I haven't found anything useful.
    Roy A., Sep 22, 2008
    #4
  5. Hvid Hat

    Hvid Hat Guest

    On 22-09-2008 23:49:12, "Roy A." wrote:

    > However, if JavaScript is disabled, you can use CSS.
    >
    > <a onmouseover="">move mouse here to see image<img ...></a>
    > a img { position: absolute; visibility: hidden }
    > a:hover img { visibility: visible }


    Very nice! Didn't even think of that. Thanks!
    Hvid Hat, Sep 22, 2008
    #5
    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. Chris
    Replies:
    0
    Views:
    552
    Chris
    Aug 3, 2005
  2. Doug
    Replies:
    4
    Views:
    42,718
    Toby Inkster
    Mar 13, 2006
  3. DLU
    Replies:
    1
    Views:
    405
  4. RodBillett
    Replies:
    3
    Views:
    389
    vMike
    Jan 5, 2004
  5. Maxi

    Image and Text display on mouseover

    Maxi, Apr 9, 2006, in forum: Javascript
    Replies:
    9
    Views:
    372
Loading...

Share This Page