[Plugin: Slideshow Gallery] gallery.js error in IE8
-
I ran into a frustrating error where a running slideshow would trigger an error in IE 8 on line 162 in “gallery.js,” usually when starting up. The error occurs inside the “TINY.height” anonymous function.
After watching it go through the debugger a few times, I noticed the pattern of the height being set to ‘-1px’ whenever the error popped up.
I may have fixed it…but it is IE and as such I can’t make promises…but I’ve got several machines running IE, FF, Chrome and Iron, and no errors yet.
Solution:
——–
You need to addif(oh<2){oh=2};
after the opening bracket following theif(oh!=h)
statement.Change:
if(oh == h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}
to:
if(oh==h){clearInterval(e.si)}else{if(oh!=h){if(oh<2){oh=2};e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}
The theory here is that TINY plus IE 8 don’t like negative ‘px’ values, so I set
oh
to 2 if it is less than 2 coming into the height-setting statement. This forces the statement to evaluate to 1 at it’s lowest value. ‘1px’ seems to make TINY happy in IE…so far.
- The topic ‘[Plugin: Slideshow Gallery] gallery.js error in IE8’ is closed to new replies.