D
daniel
Hello, I have limited understanding of js (css/html is more me) and
when I run into complicated problems I am left undone. The person I
normally call upon is on holiday so I was wondering if I could present
it here for an answer.
The page in question is http://www.sunraycomfort.com.au/p-inslab.html
(and will be applied to all other product pages)
I am using the lightbox js (from http://huddletogether.com/projects/lightbox/)
which is here:
http://www.sunraycomfort.com.au/lightbox/lightbox.js
and I am using my own (well actually Dreamweaver's) _basic_ mash of
functions that sort of get me by most of the time and can be viewed
here:
http://www.sunraycomfort.com.au/default.js
Essentially the issue is in the onLoad event being required/fired
twice. Once by Lightbox:
---------------------------------------------
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function'){
window.onload = func;
} else {
window.onload = function(){
oldonload();
func();
}
}
}
addLoadEvent(initLightbox); // run initLightbox onLoad
---------------------------------------------
And then again by the default.js:
---------------------------------------------
function runIt(){
MM_preloadImages(
...snip...
);
}
which appears as an onLoad event in the body tag of the HTML.
--------------------------------------------
With it all as it is, the image enlargement doesn't work in the
lightbox, however, if I take the onLoad event off the body tag then it
works...
How do I get them to work together?
I have removed the onLoad event from the following page so you can see
the Lightbox working:
http://www.sunraycomfort.com.au/p-undertile.html
Thanks for any help!
daniel
when I run into complicated problems I am left undone. The person I
normally call upon is on holiday so I was wondering if I could present
it here for an answer.
The page in question is http://www.sunraycomfort.com.au/p-inslab.html
(and will be applied to all other product pages)
I am using the lightbox js (from http://huddletogether.com/projects/lightbox/)
which is here:
http://www.sunraycomfort.com.au/lightbox/lightbox.js
and I am using my own (well actually Dreamweaver's) _basic_ mash of
functions that sort of get me by most of the time and can be viewed
here:
http://www.sunraycomfort.com.au/default.js
Essentially the issue is in the onLoad event being required/fired
twice. Once by Lightbox:
---------------------------------------------
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function'){
window.onload = func;
} else {
window.onload = function(){
oldonload();
func();
}
}
}
addLoadEvent(initLightbox); // run initLightbox onLoad
---------------------------------------------
And then again by the default.js:
---------------------------------------------
function runIt(){
MM_preloadImages(
...snip...
);
}
which appears as an onLoad event in the body tag of the HTML.
--------------------------------------------
With it all as it is, the image enlargement doesn't work in the
lightbox, however, if I take the onLoad event off the body tag then it
works...
How do I get them to work together?
I have removed the onLoad event from the following page so you can see
the Lightbox working:
http://www.sunraycomfort.com.au/p-undertile.html
Thanks for any help!
daniel