Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 28
  1. #1
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    is it best to use the :hover effect for a image rollover than swap image w/ javascript?

  2.  

  3. #2
    Junior Member
    Join Date
    Sep 2007
    Location
    Missouri, USA
    Posts
    5
    Member #
    15807
    In my honest option I'd rather use the :hover effect than the javascript. But guess it's what you like...

  4. #3
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    I tend to avoid Javascript for these sorts of things wherever possible.

    More people have Javascript turned off than don't have CSS browsers...

    There's some good tips here on CSS rollovers...

    http://www.edginet.org/techie/website/cssimg.html

    Sean

  5. #4
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    so really there is no need for the js rollover ..

  6. #5
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Just a different way of doing it... really is your choice...

    Sean

  7. #6
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    It's just because IE doesn't support :hover for non-links... CSS rollovers are the simplest and possibly most efficient (no extra code required), if you can manage it.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Plus, you can usually work around IE's lack of support. If nothing else, you can use a CSS rollover and then apply some Javascript decoration on top of it to ensure it works in IE, too, but still gracefully degrades. I personally always feel dirty using JS where it isn't absolutely necessary

  9. #8
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Besides, rollovers aren't really that crucial for primary functionality, right?
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  10. #9
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Regarding IE and hover behaviour, there's an interesting article here on using Microsoft's behaviours to add the hover functionality to IE...

    http://www.xs4all.nl/~peterned/csshover.html

    It's quite a neat and tidy way to do it if you really need hover effects...

    Sean

  11. #10
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    And a javascript alternative for getting :hover, :active, :target, and :focus is called suckerfish, and it has a comparison with that .htc system. Does well enough for me.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.


Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:58 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com