PDA

View Full Version : More than one ONLOAD event...?


dysfunctionGazz
11-20-2002, 11:29 AM
My page preloads images during the ONLOAD event.

I now want to put in a pop up window also.

I cant figure out how to put the two together :(

Here are the codes....




onLoad="MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif','Templates/..buttons/funovergif.gif')"


and

onload="window.open('concorde2ad.html',
'popup','width=377,height=318,left=300,top=160;newwindow.focus')

Could sum1 Please put them into one ONLOAD event for me...?

I have tried a comma, and a semicolon and cant make work ie onload="function1('blah1')","function2('blah2')"

Sorry that this is probably a dumb Q but I need to ask!!!

thanks guys/gals
Gazz

brothercake
11-20-2002, 11:44 AM
You almost had it


onload="function1('blah1');function2('blah2')"

dysfunctionGazz
11-20-2002, 11:48 AM
thanks dude thats cool of you. simple!

dysfunctionGazz
11-20-2002, 12:14 PM
:eek: Doh!


Still cant make work...

Is this wrong...

onLoad="MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif','Templates/..buttons/funovergif.gif');window.open('concorde2ad.html',
'popup','width=377,height=318,left=300,top=160;newwindow.focus')"


try www.clubdysfunction.co.uk the pop-up not happening :(

brothercake
11-20-2002, 12:48 PM
the focus event doesn't belong inside the open function - also you haven't defined an object for it; it would also be much easier to put all this in a function:


function loadFunction() {
MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif','Templates/..buttons/funovergif.gif');
var newWin = window.open('concorde2ad.html','popup','width=377,height=318,left=300,top=60');
newWin.focus();
}


then

<body onload="loadFunction()">