469,329 Members | 1,418 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,329 developers. It's quick & easy.

Safari browser javascript problem

The page appears when all the images are loaded, it works in all browsers, but safari does not turn the body visible:

<script language="javascript">
<!--
function preload() {
imgs = document.images;
preloadedimg = true;
for (var i = 0, total = imgs.length; i < total; i ++)
preloadedimg = (preloadedimg && imgs[i].complete);
if (preloadedimg) {document.body.style.visibility = "visible";}
else setTimeout("precargar()", 100);
}
//-->
</script>

<body onload="preload()" style="visibility:hidden;">
</body>

The problem can be in:
Document.body.style? Safari does it refer otherwise to body?
Thank you for attending my problem.
Mar 29 '07 #1
1 1908
iam_clint
1,208 Expert 1GB
if (preloadedimg) {document.body.style.visibility = "visible";}you might try
if (preloadedimg) {document.getElementsByTagName('body')(0).style.vi sibility = "visible";}

minus the space in visibility the forums add that sometimes
Mar 29 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Bernard | last post: by
2 posts views Thread by Marcia Gulesian | last post: by
2 posts views Thread by laredotornado | last post: by
5 posts views Thread by Bill Cohagan | last post: by
4 posts views Thread by drew197 | last post: by
34 posts views Thread by Simon Wigzell | last post: by
5 posts views Thread by Peter Michaux | last post: by
7 posts views Thread by Tom | last post: by
1 post views Thread by rynato | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.