Pure css image roll over or javascript faster?

Discussion in 'CSS' started by ketting00, Apr 1, 2011.

  1. #1
    Hi, I consider playing with image rollover buttons. But which loads faster between pure css and javascript.

    Once I go with one, it will be difficult to change because too many headache to do so. The site is user registration-base with themes to selects.

    Thanks in advance
     
    ketting00, Apr 1, 2011 IP
  2. designarti

    designarti Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Rollover. KISS rulez.
     
    designarti, Apr 1, 2011 IP
  3. ketting00

    ketting00 Well-Known Member

    Messages:
    782
    Likes Received:
    28
    Best Answers:
    3
    Trophy Points:
    128
    #3
    @designarti - what does that mean?

    It seems no one knows for sure then.
     
    ketting00, Apr 1, 2011 IP
  4. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Both will work fine if you can tweak properly.

    For Image Rollover, use preload function.
     
    RamCity, Apr 1, 2011 IP
  5. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #5
    CSS will always work faster then JS .
     
    ApocalypseXL, Apr 2, 2011 IP
  6. style0

    style0 Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    use css, and use one image with the rollover and the normal state in it and use pseudo class :hover to simply switch position on the background image to view the rollover state.
    If you use 2 separate images it might be at bit iffy with loading in IE, short delays etc.
    A small css sprite image if you will.
    JS for rollovers are always slower and the only real use is of you want more states, like mousedown, mouseup, active bla bla.
     
    style0, Apr 3, 2011 IP
  7. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Not always.
     
    RamCity, Apr 3, 2011 IP
  8. evaadams

    evaadams Peon

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    evaadams, Apr 3, 2011 IP
  9. Brunzig

    Brunzig Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    CSS Looks better in code too.
     
    Brunzig, Apr 5, 2011 IP
  10. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #10
    Proper CSS will always have less code characters then JS from a size and CPU point of view that is less work therefore faster .
     
    ApocalypseXL, Apr 5, 2011 IP
  11. Zetiz

    Zetiz Active Member

    Messages:
    668
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #11
    Obviosuly, it is CSS!! CSS will work faster than JS.
     
    Zetiz, Apr 5, 2011 IP