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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.