Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: Slideshow DHTML Javascript problem  (Read 3311 times)

0 Members and 2 Guests are viewing this topic.

sven

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
[Solved]: Slideshow DHTML Javascript problem
« 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[Solved]: Slideshow DHTML Javascript problem
« Reply #1 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
Logged

sven

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
[Solved]: Slideshow DHTML Javascript problem
« Reply #2 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
Logged
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 18 queries.