Lightbox Javascript to Flashbox Javascript
Bugs in the Lightbox script:
- Lightbox doesn’t follow when the window is scrolled, I’ve fixed this bug
- if no Image (broken link) is loaded, there is no way to stop this process, and you get no feedback
Bug #1: My fix for the scroll bug:
function onscrollChange ()
{
var arrayPageSize = getPageSize ();
var arrayPageScroll = getPageScroll ();
var lightboxTop = arrayPageScroll [1] + (arrayPageSize [3] / 15);
setTop ('flashcontent', arrayPageScroll [1]);
}
and in the showFlashbox function I started to check if the window is scrolled:
window.onscroll = onscrollChange;
Bug #2: This is a bug which will not be fixed in javascipt, but in Flash.
Lightbox HTML to Flashbox HTML
use this doctype in your html files, you need it if you want layers (
put the following lines in you directory structure and html:
Lightbox CSS to Flashbox CC
body,html {height: 100%;margin: 0;padding: 0;}
#overlay{
position: absolute;
top: 0;
left: 0;
z-index: 90;
width: 100%;
height: 500px;
background-color: #000;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}
#flashcontent{
height: 100%;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 100;
text-align: center;
line-height: 0;
}