Question about rollover scripty thing

Fringey's picture

They have: 68 posts

Joined: Apr 2001

I like rollovers, i thkn they're fun and add a lot to a page. Since the first rollover i ever coded (ahh, memories) i have been using the same code; < a href="whatever" onmouseover="rollover.src='image1.jpg'" onmouseout="rollover.src='image.jpg'" > and all of that stuff. Now i've never had any problems with it, and as far as i can remember it works on netscape and IE, yet whenever i read on these or other forums, or take a peek at the source of some nicely done site they use some complicated JScript stuff with a portion in the head and all that. This way seems so much simpler, I must be missing something. What's the deal?

Thanks.

Keegan's picture

They have: 300 posts

Joined: Aug 2001

Hi Fringey

I use

I don't know if it is any different.
It is generated by DW.

K

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

MM_swapImgRestore() and MM_swapImage() are defined in the header. That's what your seeing in the header.

You see that a lot because a lot of people use a Macromedia WYSIWYG editor to make their pages, and that's the way that Macromedia does rollevers. (MM=MacroMedia, get it?)

Mark Hensler
If there is no answer on Google, then there is no question.

Toeng.com's picture

They have: 46 posts

Joined: Sep 2001

And also because most people pre-load their images in the header to make the transition process looks nicer. Your code is fine, don't worry about a thing.

Fringey's picture

They have: 68 posts

Joined: Apr 2001

thanks all, just checking. I was afraid it didn't work for a certain os or somthing and i didn't know about it.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I've always done it the same way as you, Fringey.

tmay's picture

They have: 75 posts

Joined: Sep 2001

Me too, you're doing fine.

All the header part is doing is assigning the commands to a function name. Then in the body section, all you have to do is call on it by it's name. ( onLoad="name()" )

For simple mouseovers and small things like that, what you do is fine.

-Troy May

PC Sympathy

Admin at HFT Online

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.