Link to home
Start Free TrialLog in
Avatar of luefher
luefherFlag for United States of America

asked on

setTimeout does not work in IE

I'm about to bang my head against something real at at this point. Once again, MS proved you have to spend loads of time figuring things out, or simply go with only them.
Anyhow, I'm doing a simple thing that resizes an image on mouseover/out, and I just don't get at this point why it would not work in IE.. The idea is: have N id'd images on the page, a class for an image with some props, and a manager class that deals with them. Now, this works perfectly in FF (NS then too, havent gotten to Safari/Opera yet) - even better than I expected. IE, however, seems to call the function being passed to setTimeout only one time, and then no js errors, nothing, it's like it quits. Very needed advise is absolutely appreciated!
You can see the code live at http://www.luefher.com/images/ebay/templates/clean-blue/template.html.
Another thing, although that's rather dhtml/css, is that I've tried to position them images vertically centered, and it works with a table at the first run and relative positioning, but after mouseover it pulls to the top...
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There are more...

IE also understands px, it is more forgiving than FF so you MUST use px in FF
but you CAN use px too in IE so you can change
return px + (luefher_isIE ? '' : 'px');
to
return px + 'px';

self is reserved word and cannot be passed in a function by name
Avatar of luefher

ASKER

figured that, mplungjan :)
just tired of spending time on figuring out what it is ms thought of again :)
see later post :)
Avatar of luefher

ASKER

to mplungjan - no it doesn't understand 'px' - don't know why... it understands it later, but if you remove luefher_iePix(int) it says wrong argument on the first run...
Avatar of luefher

ASKER

self - i didn;t know that. damn.
anyhow, the whole problem was timer with oop, trying to get it ro pass an object. found a good js class here: http://devedge-temp.mozilla.org/toolbox/examples/2003/CCallWrapper/index_en.html
works like charm!