PDA

View Full Version : Lightbox_plus and IE. . .



Enomic
11-16-2008, 12:19 PM
My Lightbox_plus is working very well with Firefox, but using IE it is only showing the loading logo for the first several pictures. Later down the page the loading logo (loading image) doesn't work at all.
I can't see any differance in the script - so what. . . . ?:confused:

Eni

jscheuer1
11-16-2008, 01:47 PM
Not sure exactly what script you are using. Anyways, what often happens with lightbox type scripts is that as they are used, they incrementally preload the larger images. If that is what's happening here, what that does is eventually reach a point where the loading image (which generally only displays if the larger image isn't cached by the browser yet) no longer gets displayed.

If you want more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.

Enomic
11-16-2008, 06:26 PM
Please post a link to the page on your site that contains the problematic code so we can check it out.

The page in question. (http://sieino.mine.nu/lightboxstoff/)

Thanks,
Eno

jscheuer1
11-16-2008, 07:49 PM
Looks like an error in coding. However, that might be in conjunction with something fairly unique with your page. But I think it's just an error. Here (in lightbox_plus.js):


_set_size : function(onResize)
{
var self = this;
if (self._open == -1) return;
self._page.update();
self._pos.update();
var spin = self._wrap.firstChild;
if (spin)
{
var top = (self._page.win.h - spin.height) / 2;
//if (self._wrap.style.position == 'absolute') top += self._pos.y;
spin.style.top = [top,'px'].join('');
spin.style.left = [(self._page.win.w - spin.width - 30) / 2,'px'].join('');
}
if (Browser.isWinIE)
{
self._wrap.style.width = [self._page.win.w,'px'].join('');
self._wrap.style.height = [self._page.win.h,'px'].join('');
self._wrap.style.top = [self._pos.y,'px'].join('');
}
if (onResize) self._set_photo_size();
},

The highlighted line is adding the page's vertical scroll to how far down the page the loading image should be if the overlay is absolutely positioned, which only happens in IE. However, since the loading image is relatively positioned inside the overly which also receives the added scroll as a vertical offset, this doubles the effect pushing the loading image much farther down the page as it is scrolled than seems reasonable. I just commented that line out as shown above in red, seemed to fix it.

As I say, I'm pretty sure this is an error in coding, perhaps at one time the loading image was separate from the overlay and absolutely positioned, then that line would make sense. But putting it in the overlay is a good move for efficiency in calculating things, if that's what happened, the author simply forgot about this adjustment from before and neglected to get rid of it. It would only show up in IE on pages that were scrolled vertically.

Enomic
11-16-2008, 10:41 PM
Thank you very much for your help! You had the solution . . . .
Now it's all working well, in IE too.

Regards,

Eno

Enomic
11-20-2008, 09:48 AM
Now it's all working well, in IE too.

Not in the new IE8 ?
In my newly downloaded IE8 Beta2 it obviously has problem(s). . .?!
The first pictures open in the big format, but not the next ones.:confused:

Anyone else who has experience with IE8 and Lightbox_plus?

Eno

jscheuer1
11-20-2008, 03:07 PM
A lot of scripts and even just plain pages have problems in IE 8. As far as I understand it, it generally has to do with the way IE 8 interprets the style. In many cases, IE 8 which doesn't need as many workarounds as previous versions is still following poorly designed hacks meant for those earlier versions. Personally though, I'm not about to test stuff in IE 8 until it's released, which is currently undisclosed as far as I know, unless I get paid for it, preferably by Microsoft.

In the meantime, you may include this meta tag in the head of your page, right before the title tag:


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">

In most cases, that will take care of the problem.

See also:

http://www.dynamicdrive.com/forums/showpost.php?p=159394&postcount=1

Enomic
11-21-2008, 08:02 AM
Thanks a lot . . . . .
That made the difference!

Eno