Menu
Hi all
This code works in other major browsers but not IE (sound familiar??)
I have a DIV with a image. I’d like it to disappear after 10 seconds. In IE the image dispalys for a fraction of a second and disappears (rather than the 10 seconds…)
Any ideas??
[CODE]
<script type=”text/javascript”>
var t=”document.getElementById(‘spinner’).style.display=’none'”
</script>
<body onload=”setTimeout(t,10000)”>
thanks
Damon
[color=navy]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>untitled document</title>
<style type="text/css">
.hide{
display:none;
}
</style>
<script type="text/javascript">
function init(){
document.getElementById('spinner').className='hide';
}
window.addEventListener?
window.addEventListener('load',function(){setTimeout(function(){init()},10000)},false):
window.attachEvent('onload',function(){setTimeout(function(){init()},10000)});
</script>
</head>
<body>
<div id="spinner">
<img src="http://www.coothead.co.uk/images/anim1.gif" alt="">
</div>
</body>
</html>
[/color]
or simply...
function init(){
document.getElementById('spinner').className='hide';
}
<body onload="init()">[/QUOTE]
[code=html]
<body onload="setTimeout(function() { init(); },10000)">
[/code]
[color=navy]<body onload=".........>[/color]
[color=navy]"The more that you can actually separate your Javascript from your HTML, the easier to maintain that your web pages will [/quote]
be and the easier it will be to reuse your javascripts in multiple pages with minimum work to attach them to the page."
[/color]
That won't work, it will hide it immediately. I have a hunch maybe you meant this:
[code=html]
[/QUOTE]
<body onload="setTimeout(function() { init(); },10000)">
[/code]
[CODE]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Free School Newsletters | Safe Newsletters for Schools, Teachers, Students and Parents</title>
<meta name="keywords" content="school,newsletters,parent,teachers,schools,news">
<meta name="description" content="Free School Newsletters for Schools and Parents. Open a free account and start sending your school newsletters today">
<link rel="canonical" href="http://safenewsletters.com"/>
<script type="text/javascript">
function test()
{
//document.getElementById('spinner').style.display='none';
document.getElementById('pdf').style.display='block';
}
</script>
</head>
<body onload="setTimeout('test()',20000);">
<p>Your School Newsletters are powered by
<a target="_blank" href="http://safenewsletters.com">Safe Newsletters</a> | Check out our
<a target="_blank" href="http://www.facebook.com/pages/Free-School-Newsletters/198310076880025">facebook page</a>
<p>
<div id="spinner" style="display:block;z-index:10;position:absolute;top:100px;width:100%;background:white;">
<p align="center">
<img src="/images/spinner.gif"></p>
<p align="center">
Be patient. Your Newsletter will continue loading...<br>
Large newsleters may take a while ... but it will open...
</p>
<p align="center">
</p>
</div>
<div id="pdf" style="display:none;z-index:10;position:absolute;width:99%;height:85%">
<iframe name="I1" src="<%=request.querystring("url")%>" height="100%" width="100%" allowtransparency="true">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
<p align="center"><font face="Times New Roman">© Safe Newsletters</font></p>
</div>
</body>
</html>
[/CODE]
[color=navy]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<style type="text/css">
html,body {
height:100%;
margin:0 10px;
}
#links {
padding:10px 0 80px 0;
}
#spinner {
text-align:center;
}
#pdf {
width:99%;
height:85%;
}
.hide {
display:none;
}
.vis {
visibility:hidden;
}
</style>
<script type="text/javascript">
function init(){
document.getElementById('spinner').className='hide';
document.getElementById('myiframe').className='';
}
window.addEventListener?
window.addEventListener('load',init,false):
window.attachEvent('onload',init);
</script>
</head>
<body>
<div id="links">Your School Newsletters are powered by
<a target="_blank" href="http://safenewsletters.com">Safe Newsletters</a> | Check out our
<a target="_blank" href="http://www.facebook.com/pages/Free-School-Newsletters/198310076880025">facebook page</a>
</div>
<div id="spinner">
<img src="http://safenewsletters.com/images/spinner.gif" alt="">
<p>
Be patient. Your Newsletter will continue loading...<br>
Large newsleters may take a while ... but it will open...
</p>
</div>
<div id="pdf">
<iframe id="myiframe" class="vis" name="I1" src="http://www.swanbourneprimary.wa.edu.au/public/documents/4/Sports%20Page%20No%205%20010911.pdf" width="100%" height="100%">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
</div>
</body>
</html>
[/color]
[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<style type="text/css">html, body{height:100%;margin:0 10px;}
#links{padding:10px 0 80px 0;}
#spinner{text-align:center;}
#pdf{width:99%;height:85%;}
.hide{display:none;}
.vis{visibility:hidden;}
</style>
</head>
<body>
<div id="links">Your School Newsletters are powered by
<a target="_blank" href="http://safenewsletters.com">Safe Newsletters</a> | Check out our
<a target="_blank" href="http://www.facebook.com/pages/Free-School-Newsletters/198310076880025">facebook page</a>
</div>
<div id="spinner">
<img src="http://safenewsletters.com/images/spinner.gif" alt="">
<p>
Be patient. Your Newsletter will continue loading...<br>
Large newsleters may take a while ... but it will open...
</p>
</div>
<div id="pdf">
<iframe id='myiframe' class="vis" name="I1" src="http://www.swanbourneprimary.wa.edu.au/public/documents/4/Sports%20Page%20No%205%20010911.pdf" width="100%" height="100%">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
</div>
<script type="text/javascript">
document.getElementsByTagName('iframe')[0].onload = function() {
document.getElementById('spinner').className='hide';
document.getElementById('myiframe').className='';
}
</script>
</body>
</html>
[/code]
But because I'm loading in an iframe from a different site... its not working so well.[/QUOTE]
There is no possible JavaScript full relationship between documents which do not belong to the same domain[/QUOTE]
007
@KOR is there a policy in the TOS somewhere against links?? Can you point me toward the relevant policy? I may have missed it. [/QUOTE]
The link is my link for my own business.[/QUOTE]
Oh.
I'm a super moderator too and I usually allow a little SEO link juice to those who make genuine contributions to the board.[/QUOTE]
0.1.9 — BETA 6.2