Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Multiple functions with "onload" does not work.

Multiple functions with "onload" does not work.

Kalew
03-18-2006, 12:22 AM
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">&nbsp;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
}


 

TOP

Hyperthreading hurts s
HP sharpens blade PC l
Apple goes for Quad po
Itanium gets scaled do

For more info

HP sharpens blade PC l
Hyperthreading hurts s
can not call click() i
script does not work o
smart menu 
write to an html file 
FireFox doesn't recogn
Changing e.keyCode (e.
Clearing a range creat
UPDATE: My mouse over 

News Archive

onChange Help 
beforeload? vs onload.
Problem with document.
decreasing my javascri
Problem with \\ and \ 
how to stop scrolling?
Change Label Text Colo
Can I forward a page b
2 javascript functions
Validating a textbox 

Related stories:

javascript and layers
Form code that puts a price relative to an item # in another field
Forcing User to Scroll through Text Box
Confirm delete in href of display:column tag
onChange="submit()" for select only works once
Pop Up Javascript
Call function when user closes browser
Disabling F1, F3, etc. default actions
Link to root

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics