PDA

View Full Version : Two scripts on same page...



ashew
12-04-2007, 07:44 PM
1) Script Title: Script Title: Slideshow and snow falling script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm

http://www.dynamicdrive.com/dynamicindex3/snow.htm

3) Describe problem:
General question....for a couple of years I've tried to include two scripts on the same page and the addition of the second script ALWAYS messes up the first. I'm wanting to use the falling snow script on a webpage that already has a slideshow....getting the word undefined instead of my pictures in the slideshow when I add the snow falling script under the <body>. What am I doing wrong? I've also tried to have mouse trails on pages with slideshow scripts in the past to no avail. Please help!

Thanks so much for any help!!!

ashew
12-06-2007, 06:52 PM
Anyone know how to do this?

ddadmin
12-06-2007, 09:49 PM
Some of the older scripts on DD will step on one another's toes if two or more of them exist on the same page, due to both trying to access the window.onload event handler. In this case, you can try fixing that by finding the line:


window.onload=fillup

Inside the slideshow script, and changing that to:


if (window.addEventListener)
window.addEventListener("load", fillup, false)
else if (window.attachEvent)
window.attachEvent("onload", fillup)