Jump to content

Rollover - one method vs. another


JustGotAQuestion

Recommended Posts

So i was wondering what method, of the two i am about to describe, is the best for making rollovers, and why.

 

1. This is the way i do it

<img src="img.gif" onmouseover="src='img_over.gif'" onmouseout="src='img.gif'" />

 

2. This is more complicated, but i'm wondering if its better

I can't actually do it, but its the javascript method that dreamweaver does for you. I think it preloads the images and then "swaps" them or something.

 

 

Please make sure to include why one is better. I like my way because its simple, but is it worse in any way?

Link to comment
https://forums.phpfreaks.com/topic/99855-rollover-one-method-vs-another/
Share on other sites

  • 3 weeks later...

Awesome, i didn't even think to use css... Here is what i've found:

 

Pros:

Eliminates clutter. Using an external stylesheet, i don't need to confuse myself by looking through lines of rollover code on my main page.

 

Cons:

Images take a second to load. Is there a way to preload the images AND use the css method?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.