Shoutbox

Javascript Page Loading??? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Javascript Page Loading??? (/showthread.php?tid=74228)

Javascript Page Loading??? by Ashylay on 05-07-2007 at 06:25 PM

Okay so I know its possible to get a javascript script that when you open a page it displays Page Loading... whiles the page loads and then opens the page when its fully loaded.

But I was wondering how you make something like this:

CLICK HERE

I want the script so that it covers the page in a translucent black cover with an image and some text saying loading. Any help? PLEASE


RE: Javascript Page Loading??? by hmaster on 05-07-2007 at 06:27 PM

The link doesn't work.


RE: Javascript Page Loading??? by Ashylay on 05-07-2007 at 06:28 PM

Works now :)

I know that is also used on habbo.co.uk because HabboRemix is a fansite of it. If you cant see the image it is displayed on Habbo.co.uk but only on certain pages.


RE: Javascript Page Loading??? by Chris4 on 05-07-2007 at 09:14 PM

Habbo.. haha. I remember that. Hmm, wonder if I can still log in..

Yay I can lol :P

Code from habboremix.net

code:
<div id=loading style="
position:absolute;
cursor:hand;
    top: 0;
    left: 0;
    width: 110%;
    height: 2000;
    z-index: 9000;
    background-color: black;
    -moz-opacity: .5;
    opacity: .50;
    filter: alpha(opacity=50);"><table width=100% height=600><tr valign=middle center=top><td valign=middle center=top><center><img src=http://www.habboremix.net/img/MFITV3LEIGS1CYU.gif><br/>
<font style="text-align: center;
    font-weight: bold;
    font-size: 12px;" color="#ffffff"><b>Please wait!</b></font></center></td></tr></table></div>

Obviously don't use that exact code. Change the image, etc. I'd also reccomend contacting them first before using the code.
RE: Javascript Page Loading??? by Verte on 05-08-2007 at 04:01 AM

People are always quick to push for Javascript when there is usually an easier CSS solution. The great thing about CSS is, it works on more browsers, and doesn't require that evil of web 2.0, client-side scripting!


RE: Javascript Page Loading??? by markee on 05-08-2007 at 04:28 AM

quote:
Originally posted by Verte
People are always quick to push for Javascript when there is usually an easier CSS solution. The great thing about CSS is, it works on more browsers, and doesn't require that evil of web 2.0, client-side scripting!
But client-side is very good as it requires very little for the server to do and as such makes it more accessible to everyone, although it shouldn't be used to replace something static like CSS.  Javascript can be incredibly useful, but as you said, everything has a time and a place and the best overall method should be the one used and not just what the common trend is or just running with an idea without thinking about it.
RE: Javascript Page Loading??? by -dt- on 05-08-2007 at 04:28 AM

quote:
Originally posted by Verte
People are always quick to push for Javascript when there is usually an easier CSS solution. The great thing about CSS is, it works on more browsers, and doesn't require that evil of web 2.0, client-side scripting!
what the hell are you on about? you still need javascript for this :-/ theres no "show this till load" css
RE: Javascript Page Loading??? by Dennis Mike on 05-08-2007 at 04:44 AM

code for show image loading and show percent of load


code:
function precargar()    {
    var dibujos = new Array(precargar.arguments.length);
    for (var i = 0; i < dibujos.length; i ++)    {
        dibujos[i] = new Image();
        dibujos[i].src = precargar.arguments[i]
    }
    return dibujos;
}

function precargados(dibujos)    {
    var parciales = true;
    for (var i = 0; i < dibujos.length; i ++)
        parciales = (parciales && dibujos[i].complete);
    return parciales;
}

function porciento(dibujos)    {
    var parciales = 0;
    for (var i = 0; i < dibujos.length; i ++)
        parciales += (dibujos[i].complete) ? 1 : 0;
    return parseInt(100 * parciales / dibujos.length);




code:
var imagenes;
function continuar()    {
    alert("Ok.");
}

function cargando()    {
    document.getElementById("estado").style.width = porciento(imagenes) + "%";
    if (precargados(imagenes))
        continuar();
    else
        setTimeout("cargando()", 100);
}

function ini()    {
    imagenes = new precargar("img0.jpg",
        "img1.jpg",
        "img2.jpg",
        "img3.jpg",
        "img4.jpg",
        "img5.jpg",
        "img6.jpg",
        "img7.jpg",
        "img8.jpg"
    );
    cargando();




code:
<div style="position:relative; width: 100px; height: 20px; border: 1px" >
<div style="position:absolute; top: 0; left: 0; width:100%; height: 100%; background-color: blue" >
</div>
<div id="estado"
style="position:absolute; top: 0; left: 0; width: 1%; height: 100%; background-color: aqua" >
</div>
</div>





RE: RE: Javascript Page Loading??? by Verte on 05-08-2007 at 05:18 AM

quote:
Originally posted by -dt-
quote:
Originally posted by Verte
People are always quick to push for Javascript when there is usually an easier CSS solution. The great thing about CSS is, it works on more browsers, and doesn't require that evil of web 2.0, client-side scripting!
what the hell are you on about? you still need javascript for this :-/ theres no "show this till load" css


For a long time I would have agreed, I haven't done it myself so I'm not sure. But many things have suprised me, I've seen drop down menus and OnHover sort of stuff done using only css, which I never thought possible.

BTW, The page in question relies on a plugin [I believe ActiveX] calling dd.elements.loading.hide(). [JS]
RE: Javascript Page Loading??? by hmaster on 05-08-2007 at 07:07 AM

quote:
Originally posted by Verte
For a long time I would have agreed, I haven't done it myself so I'm not sure. But many things have suprised me, I've seen drop down menus and OnHover sort of stuff done using only css, which I never thought possible.

BTW, The page in question relies on a plugin [I believe ActiveX] calling dd.elements.loading.hide(). [JS]
That's because CSS has a :hover property? But it doesn't have an onload() function like JS.
That page may use an ActiveX but I'm not sure its really needed *-).
RE: RE: Javascript Page Loading??? by Verte on 05-08-2007 at 11:14 AM

quote:
Originally posted by hmaster
quote:
Originally posted by Verte
For a long time I would have agreed, I haven't done it myself so I'm not sure. But many things have suprised me, I've seen drop down menus and OnHover sort of stuff done using only css, which I never thought possible.

BTW, The page in question relies on a plugin [I believe ActiveX] calling dd.elements.loading.hide(). [JS]
That's because CSS has a :hover property? But it doesn't have an onload() function like JS.
That page may use an ActiveX but I'm not sure its really needed *-).


It's not, I was just saying in case you weren't sure. Erm, part of me thinks whatever you're waiting to load could contain a little css at the end which hides the loading screen or something. I'm pretty sure that's not it, but that it involves a similar trick.
RE: RE: Javascript Page Loading??? by Ashylay on 05-09-2007 at 06:36 PM

quote:
Originally posted by Chris4
Habbo.. haha. I remember that. Hmm, wonder if I can still log in..

Yay I can lol :P

Code from habboremix.net
code:
<div id=loading style="
position:absolute;
cursor:hand;
    top: 0;
    left: 0;
    width: 110%;
    height: 2000;
    z-index: 9000;
    background-color: black;
    -moz-opacity: .5;
    opacity: .50;
    filter: alpha(opacity=50);"><table width=100% height=600><tr valign=middle center=top><td valign=middle center=top><center><img src=http://www.habboremix.net/img/MFITV3LEIGS1CYU.gif><br/>
<font style="text-align: center;
    font-weight: bold;
    font-size: 12px;" color="#ffffff"><b>Please wait!</b></font></center></td></tr></table></div>

Obviously don't use that exact code. Change the image, etc. I'd also reccomend contacting them first before using the code.


Why contact them? Its Habbos main idea anyways with the release of V11. They introduced that little script on the site. HabboRemix just in my eyes has stole near enough every idea from the habbo Website.

AND I cant be breaking any laws? You cant copyright an idea and Im guessing you cant trademark a script?

AND It doesnt close on page load?????
RE: RE: RE: Javascript Page Loading??? by Verte on 05-10-2007 at 04:11 AM

quote:
Originally posted by Ashylay
AND I cant be breaking any laws? You cant copyright an idea and Im guessing you cant trademark a script?

AND It doesnt close on page load?????


You can't trademark a script. The only thing you can trademark is a name. You can copyright a script, but what you see is not a script, it's a couple of HTML tags rich in CSS. Now, it doesn't close on page load, it actually closes when a plugin says it's loaded, when the plugin calls the Javascript function dd.elements.loading.hide().

In fact, the habboremix loading thing does not close when the page loads, it closes when the plugin begins working. So, you're going to need to meditate on this problem a little longer :P
RE: RE: RE: RE: Javascript Page Loading??? by Just-one on 07-03-2007 at 11:56 PM

quote:
Originally posted by Verte
quote:
Originally posted by Ashylay
AND I cant be breaking any laws? You cant copyright an idea and Im guessing you cant trademark a script?

AND It doesnt close on page load?????


You can't trademark a script. The only thing you can trademark is a name. You can copyright a script, but what you see is not a script, it's a couple of HTML tags rich in CSS. Now, it doesn't close on page load, it actually closes when a plugin says it's loaded, when the plugin calls the Javascript function dd.elements.loading.hide().

In fact, the habboremix loading thing does not close when the page loads, it closes when the plugin begins working. So, you're going to need to meditate on this problem a little longer :P


Under UK Copyright Law, any computer programming is automatically copyrighted to the author. This makes copying, modifying, and ofcourse, selling any computer prorgamming created by someone else without their prior permission.

So yes, I think they should contact me before stealing coding. ClubHabbo attempted stealing coding from us, and they learnt the hard way by having their homes shut down on every host they've tried hosting their script with all of my Javacript coding on. Why people don't just learn Javascript and take the time to do their own work instead of stealing others credit and taking coding claiming they made it is beyond me.

James Parmee Morris
HabboRemix.net Owner
RE: RE: RE: RE: RE: Javascript Page Loading??? by Verte on 07-04-2007 at 09:54 AM

quote:
Originally posted by Just-one
quote:
Originally posted by Verte
You can copyright a script, but what you see is not a script, it's a couple of HTML tags rich in CSS


Under UK Copyright Law, any computer programming is automatically copyrighted to the author. This makes copying, modifying, and ofcourse, selling any computer prorgamming created by someone else without their prior permission.

So yes, I think they should contact me before stealing coding. ClubHabbo attempted stealing coding from us, and they learnt the hard way by having their homes shut down on every host they've tried hosting their script with all of my Javacript coding on. Why people don't just learn Javascript and take the time to do their own work instead of stealing others credit and taking coding claiming they made it is beyond me.

James Parmee Morris
HabboRemix.net Owner

While the code shown is all of the code for displaying things until the page is loaded, the thing of importance here is one tag- the first div. Ashlay is looking for a method to hide elements, and this is the important tag, the one that must enclose anything you want to hide. I imagine that that tag with all of its attributes will not suit what Ashlay is doing, whatever it is, but even in the event that this tag were copied verbatim, I would think that copying a single tag would be within fair use.

EDIT: Fixed punctuation error.
RE: Javascript Page Loading??? by roflmao456 on 07-05-2007 at 01:54 AM

lol.

* roflmao456 tries.

code:
<script language='javascript'>
function init(){
document.getElementById("load").style.display="none";
document.body.style.visibility="visible";
}

window.onload=init;
document.body.style.visibility="hidden";
</script>

<div id="load">Page is loading! Please wait.</div>

RE: RE: RE: RE: RE: RE: Javascript Page Loading??? by rav0 on 08-18-2007 at 04:21 AM

quote:
Originally posted by Verte
quote:
Originally posted by Just-one
quote:
Originally posted by Verte
You can copyright a script, but what you see is not a script, it's a couple of HTML tags rich in CSS


Under UK Copyright Law, any computer programming is automatically copyrighted to the author. This makes copying, modifying, and ofcourse, selling any computer prorgamming created by someone else without their prior permission.

So yes, I think they should contact me before stealing coding. ClubHabbo attempted stealing coding from us, and they learnt the hard way by having their homes shut down on every host they've tried hosting their script with all of my Javacript coding on. Why people don't just learn Javascript and take the time to do their own work instead of stealing others credit and taking coding claiming they made it is beyond me.

James Parmee Morris
HabboRemix.net Owner

While the code shown is all of the code for displaying things until the page is loaded, the thing of importance here is one tag- the first div. Ashlay is looking for a method to hide elements, and this is the important tag, the one that must enclose anything you want to hide. I imagine that that tag with all of its attributes will not suit what Ashlay is doing, whatever it is, but even in the event that this tag were copied verbatim, I would think that copying a single tag would be within fair use.
It wouldn't be within fair use, because it wouldn't even be under copyright. Tags are intrinsic to HTML, and researching other people's (copyrighted) code to learn what tag is suitable to use is perfectly fine. Small snippets of code would not make up a significant enough portion of the copyrighted work to actually be infringing of the copyright. You might want to contact the original author anyway (remember that they have no claim over tiny snippets), but in a case like this, I wouldn't, while in different circumstances I might.
RE: RE: RE: RE: RE: RE: RE: Javascript Page Loading??? by Verte on 08-18-2007 at 04:34 PM

Words, such as "It, be, within, fair, use", were all used in my post, and are copyright.

That's pretty much the basis of his argument.

EDIT: and if the sarcasm wasn't obvious, no, giving an element an ID and calling hide on it is not copyright.

By the way, for the original writers of the thread: http://www.websiteoptimization.com/speed/tweak/defer/