471,854 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 software developers and data experts.

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);

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

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 1937
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 YellowAndGreen | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.