PDA

View Full Version : Lightbox image viewer help



ff123
09-30-2009, 02:07 PM
1) Script Title:
Lightbox image viewer

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex4/lightbox/index.htm

3) Describe problem:

im using this script and i have another script in another js file and their is specific function in that script which i am calling in my html <body> tag like this <body onload="init();">
because of this this script does not work but i should call this function too.

any helP?

jscheuer1
09-30-2009, 03:07 PM
At the end of the lightbox.js file, change:


addLoadEvent(initLightbox); // run initLightbox onLoad

to:


addLoadEvent(function(){initLightbox();init();}); // run initLightbox onLoad

And because some browsers might then run your init(); function twice, remove the onload statement from the body tag.

There could also be other issues.

ff123
09-30-2009, 03:35 PM
At the end of the lightbox.js file, change:


addLoadEvent(initLightbox); // run initLightbox onLoad

to:


addLoadEvent(function(){initLightbox();init();}); // run initLightbox onLoad

And because some browsers might then run your init(); function twice, remove the onload statement from the body tag.

There could also be other issues.


i tried this code but the problem is still there.. but i cannot remove init() from my body tag if I do that my script other than lighbox does not work than..

ff123
09-30-2009, 03:52 PM
bro it worked thanx..