onload two different events

asuh

Golden Member
Sep 7, 2002
1,059
2
91
I currently am trying to use two onload script events to load rollover images as well as a CSS based menu. When I have one onload, the other event doesn't work. So it's one or the other.

To be specific, I have a window.onload=startList; from a .js file and the other script is onload="preloadImages()" in the Body tag. From my research, one or the other must be deleted. Is there a way to make both of these work?
 

asuh

Golden Member
Sep 7, 2002
1,059
2
91
Okay, what you wrote sounds good. Now I need to know how to combine the two different function scripts. I'm not familiar with the proper syntax to write both of these codes so that I can combine all of the functions, but do I just include your code at the end of a bunch of strings of functions?
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: asuh
Okay, what you wrote sounds good. Now I need to know how to combine the two different function scripts. I'm not familiar with the proper syntax to write both of these codes so that I can combine all of the functions, but do I just include your code at the end of a bunch of strings of functions?

could you clarify that? just include that function like any other...
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: asuh
I can't actually include the script in here! So, here's a link directly to the scripts that I need to combine into one.

iemenu.js
rollover.js

OK, just merge them with notepad.

Quick question: is this even correct syntax?: startList = function() {
 

asuh

Golden Member
Sep 7, 2002
1,059
2
91
So you mean, just as they are, cut and paste them into one js file?

And to reference the syntax question, here's where I got that code.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: asuh
So you mean, just as they are, cut and paste them into one js file?

And to reference the syntax question, here's where I got that code.

Yes that should work.

Well if it works the syntax is right I guess.