469,277 Members | 2,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

IE not supporting image swap.

Markus
6,050 Expert 4TB
My javascript is a little sketchy, so forgive me*.

What I'm doing is pre-loading 2 images with javascript, and then when one image is mouseover'd, that image's src attribute is swapped with the second images.

You can see it here: Untitled Document

Works fine in most browsers, but I was stupid enough to assume IE would act the same.

* Yeah, I hate those 'pitty me' intros too.
Jan 22 '09 #1
5 1057
Dormilich
8,651 Expert Mod 8TB
that's because addEventListener() is not supported by IE. two possibilities, apply attachEvent() for IE or google for the cross browser function addEvent() (there are different available, choose the one you like)
Jan 22 '09 #2
Markus
6,050 Expert 4TB
@Dormilich
Ah, that's good to know. Cheers, Dorm.
Jan 22 '09 #3
Dormilich
8,651 Expert Mod 8TB
I wish more people would use Event Listeners. I'm truly relieved I found one in you, although you could have made the onload event this way too.
Jan 22 '09 #4
Markus
6,050 Expert 4TB
@Dormilich
Well, to be honest, I only knew of them because of yourself. :P So you can pat yourself on the back.
Jan 23 '09 #5
Dormilich
8,651 Expert Mod 8TB
@Markus
done...................
Jan 23 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.