SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image Rollover Question

    Hey, just a quick question, ladies and gentlemen-

    Does anybody know off-hand which browsers don't support onMouseOver/onMouseOut right in an <img> tag, and only in a surrounding <a>?

    Much obliged.

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that all the browsers made since 1999 (save for Lynx) will support it. But why would you want to use it when you can employ CSS instead? (The only reason I can see for the use of JavaScript in this case would be to apply a delay to prevent the image rollover from firing right away.)

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    I'm pretty sure that all the browsers made since 1999 (save for Lynx) will support it. But why would you want to use it when you can employ CSS instead? (The only reason I can see for the use of JavaScript in this case would be to apply a delay to prevent the image rollover from firing right away.)
    Well, it's mostly for two reasons - I -am- planning to play around and modify the behavior of the rollover, but the other reason is that with JS, I can pre-load the images to the cache, so the rollover is instant.

    I understand I can pre-load them with JS and then make them rollover with CSS, but I'm in the process of learning JS properly, so I'm just trying everything I can out.

    Thanks for the answer to the problem, by the way. ^-^

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah. Well, I don't know if you're aware of this, but if you combine the default and rollover images into a single graphic, you can "pre-load" the hover with CSS as well. All you'd have to do is "slide up" the image on :hover :active and :focus.

    Hmm... that makes me wonder if you can use CSS for the rollover itself, and then as an add-on use JavaScript to modify the behavior of the rollover effect.

    One of the JavaScript gurus here would be able to answer that though.


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
  •