471,893 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

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 1084
Dormilich
8,658 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,658 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,658 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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.