You are here: Re: Such a command as 'onbeforeload'? « HTML « IT news, forums, messages
Re: Such a command as 'onbeforeload'?

Posted by nolo contendere on 11/15/07 14:30

On Nov 15, 5:44 am, "CJS" <a...@anon.com> wrote:
> "nolo contendere" <simon.c...@fmr.com> wrote in message
>
> news:1195066138.248524.40570@50g2000hsm.googlegroups.com...
>
> > On Nov 14, 2:33 pm, "CJS" <a...@anon.com> wrote:
> >> Hi, I have a javascript popup which I want to happen BEFORE the rest of
> >> the
> >> page loads. It's something for people to read while quite a heavy page
> >> loads behind it.
>
> >> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> >> doesn't pop up at all then.
>
> > I didn't see such an event. But what are you trying to accomplish?
> > Perhaps there is a way to do what you require via another path.
>
> Simply what I want to accomplish is the popup to come up *first* befoer any
> other page elements load. It is complicated as to why, and other factors,
> but that is what needs to happen.
>
> The onload tag seems to open happen after the page has finished loading
> completely, which is odd.

Try something like this:

<html>
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
function kill_loader() {
$('loader').style.display = 'none';
$('contents').style.display = 'block';
}
</script>
</head>
<body onload="kill_loader();">
<div id=loader style="display: block; overflow: auto; valign: middle;
text-align: center; background-color: #fff; width: 100%; height:
100%;">
<img src="images/spinner.gif" />
</div>
<div id=contents style="display: none;">hi there</div>
</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация