I am having a heck of a time trying to figure this out: I have a slideshow javascript that I want to execute via the onload handeler in the body tag, as well as some navigation links that are supposed to be executed via onload. However, only the slideshow is working correctly. The navigation links are no longer positioned where they should be when I have the "runslideshow" with the onload. I tried creating a wrapper function and calling that (rather than list both functions in the onload event), but it did not seem to work. I wonder if the 'P7_snap' verbage is messing things up (as I have no idea what that means). Maybe I did not set-up the wrapper function correctly. Perhaps someone could show me correctly?
Following is the slideshow script and then the onload string (condensed); thank you for your assistance and/or suggestions:
SLIDESHOW SCRIPT
<script>
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 2000
// Duration of crossfade (seconds)
var crossFadeDuration = 10
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = 'fireanimation.gif'
Pic[1] = 'folder.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans (duration=2)"
document.images.SlideShow.style.filter="blendTrans (duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply ()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play( )
}
j = j + 1
if (j < (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
NAVIGATION WITH ONLOAD
<body onLoad= "runSlideShow(); P7_Snap('AboutUsImg','AboutUsNav',0,12);P7_Snap('CommunitiesImg','CommunitiesNav',0,12);P7_Snap('AboutUsImg','Trigger',-50,-30);P7_Snap('CommunitiesImg','CommunitiesNav',0,12);P7_Snap('AboutUsImg','Trigger',-50,-30);P7_Snap continues...">
<div id="AboutUsNav" style="position:absolute; left:134px; top:119px; width:150; height:100; z-index:10; visibility: hidden">
class="linksOUT1" onMouseOver="this.className='linksOVER1'" onMouseOut="this.className='linksOUT1'" onClick="MM_goToURL('parent','/aboutus.shtml');return document.MM_returnValue"> Our Story</td>
</tr>
_Aerospace_Eng_
03-18-2006, 01:19 AM
You need to remove all of those in your body tag and create a function onload that calls those in the script tags.
window.onload = function()
{
function1();
function2();
function3();
// etc
}