Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Page loader script problem not work in IE
Old 12-31-2008, 04:10 AM Page loader script problem not work in IE
Junior Talker

Posts: 2
Name: Rushi
Trades: 0
Hello i am very new to this forum ,

I want to implement page loader functionality means while loading page first it load loader image and in background it can load total page and when page load properly the loader image is to invisible. and i am using the following code

<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>




<body onLoad="init()" >
<div align="center" id="loading" style="position:absolute; height:100%; width:100%; text-align:center; top:0px; background-color:gray; opacity:0.6; filter:alpha(opacity=50); " >

<div style="top:300px; padding-top:300px; ">
<img src="<?=WEB_ROOT;?>/images/loading1.gif" align="center" border="0" style="background-color:#FFFFFF; ">
<br/>
<br/>
<p style="font-size:20px ">
<strong style="color:#FFFFFF ">Please Wait......Loading Results</strong>
</p>
</div>
</div>


</body>



This code is properly work in Firefox but not work in Internet Explorer.
Why???
If any changes that i have to make in code please send me....
Please any one can help me???????
rushiags is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-04-2009, 04:47 PM Re: Page loader script problem not work in IE
jason_bristol's Avatar
Ultra Talker

Latest Blog Post:
New site - ConnectFrench.com
Posts: 310
Name: Jason Eyermann
Location: england bristol
Trades: 0
I'm not sure why you're doing an if statement for browsers like ie4. I really don't think anyone uses that anyone, and I mean no-one.

There are easier ways to add a gif loader.

1. You can add an animated gif to one of your divs backgrounds using just css.
Code:
div#imageLoader {
      background: url(images/loaderImage.gif) no-repeat centre centre;
}
or 2. Do a simple javascript like

Code:
window.onload = loadFunction;

function loadFunction() {
        document.getElementById("imageLoader").style.display = "none";
}
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
jason_bristol is offline
Reply With Quote
View Public Profile Visit jason_bristol's homepage!
 
Old 01-04-2009, 06:28 PM Re: Page loader script problem not work in IE
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
if (ns4)
ld=document.loading;

...should be...

if (ns4)
ld=document.loading.style;

... I think.
I'm not really into these things though, but I'd say that's what's missing logically.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Page loader script problem not work in IE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.13204 seconds with 12 queries