[Solved]: Slideshow DHTML Javascript problem [Solved]: Slideshow DHTML Javascript problem
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: Slideshow DHTML Javascript problem

Started by sven, April 06, 2004, 11:08:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sven

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

Joachim Müller

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

sven

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