coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: sven on April 06, 2004, 11:08:17 AM

Title: [Solved]: Slideshow DHTML Javascript problem
Post by: sven on April 06, 2004, 11:08:17 AM
Hello,

I've included the Coppermine Photo Gallery on the following page
http//hildebrandt.no/sven/albums/index.php

As you can see I've included a DHTML menu on top of the page. The problem is that when the DHTML menu is included the SlideShow function on the gallery doesn't work. When the new picture is going to load I get the following error from the IE browser

preLoad[...].src is null or not an object

I think the DHTML menubar interferes with the photogallery in some way, but I don't know how.

Can anyone help me solve this problem, and find a workaround?

If I remove the follwong from the bottom of the page
<script type="text/javascript" language="javascript1.2" src="resources/menu.js"></script> , the slideshow works. But then of course the DHTML-menu doesn't work, as it is that line that calls the menubar.  I want to have the menu to work as well as the slideshow function.

Please?

Best regards,
Sven from Norway
Title: [Solved]: Slideshow DHTML Javascript problem
Post by: Joachim Müller on April 07, 2004, 07:20:27 AM
without looking into this in detail my guess is that you're trying to use one JavaScript event twice (body onload or winow onload), or your dhtml menu is using the same function names the coppermine slideshow does. Take a look at http://www.wsabstract.com/javatutors/multiplejava.shtml

GauGau
Title: [Solved]: Slideshow DHTML Javascript problem
Post by: sven on April 07, 2004, 09:07:15 PM
Thank you for replying gaugau.

I was in the middle of writing a second post when I solved the problem. There are no onloads in my body tag or in the slideshow script. Thank you for the link anyhow.

The problem was related to the following line in the slideshow script:

document.images.SlideShow.src = preLoad[j].src

The script just stopped there. The error message was as follows:
preLoad[...].src is null or not an object

Then I tought: 'The j is not being filled. Maybe the j variable is being used by the DHTML-menu. I'll give it a shot and try to change j all places in the script to k (just because k is after j in the alphabet)'

So I did, and then it worked! Lucky try!

document.images.SlideShow.src = preLoad[k].src