Reply
Simple page loader script trouble!
Old 01-28-2008, 07:40 PM Simple page loader script trouble!
Junior Talker

Posts: 3
Hey guys,
First of all I would like to say hello to everybody, this is my first post and first time here, sorry about my english, I'm brazillian.

I'm not an expert at Javascript and those scripts were found in web.

I'm building my webpage and I'm using two scripts to load the pictures before the page shows up.

The first script loads all images in my website.
<body onLoad="waitPreloadPage();">

Quote:
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
function waitPreloadPage() {
if (document.getElementById){
document.getElementById('prepage').style.visibilit y='hidden';
}else{
if (document.layers){
document.prepage.visibility = 'hidden';
}
else {
document.all.prepage.style.visibility = 'hidden';
}
}
}
</SCRIPT>
The second script loads the rollover images before they are asked to show up. (Dreamweaver feature)
<body onLoad="MM_preloadImages('images/index2_14.gif','images/index2_15.gif','images/index2_16.gif')">

My problem is that I cannot use both at same time.

I was trying like:
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="waitPreloadPage();" onLoad="MM_preloadImages('images/index2_14.gif','images/index2_15.gif','images/index2_16.gif')">

And the first script is working and the second isn't.
Would it be because I'm using the onLoad="" function two times?
What can I do to make them both work together?
gbrl is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-28-2008, 11:49 PM Re: Simple page loader script trouble!
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 984
Name: Jeremy Miller
Location: Reno, NV
Try a wrapper function:

HTML Code:
<script>
function onLoadFunction() {
waitPreloadPage();
MM_preloadImages('images/index2_14.gif','images/index2_15.gif','images/index2_16.gif');
}
</script>
<body onLoad="onLoadFunction();">
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-29-2008, 12:33 AM Re: Simple page loader script trouble!
Junior Talker

Posts: 3
It worked perfectly well!
Thanks man!
gbrl is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Simple page loader script trouble!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12643 seconds with 12 queries