What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Javascript Page Loading???

Pages: (2): « First [ 1 ] 2 » Last »
Javascript Page Loading???
Author: Message:
Ashylay
Junior Member
**

Intermediate Scripter

Posts: 70
Reputation: 1
– / Male / –
Joined: Mar 2007
O.P. Javascript Page Loading???
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

This post was edited on 05-07-2007 at 06:29 PM by Ashylay.
05-07-2007 06:25 PM
Profile E-Mail PM Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: Javascript Page Loading???
The link doesn't work.
[Image: sig.png]
05-07-2007 06:27 PM
Profile PM Web Find Quote Report
Ashylay
Junior Member
**

Intermediate Scripter

Posts: 70
Reputation: 1
– / Male / –
Joined: Mar 2007
O.P. RE: Javascript Page Loading???
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.

This post was edited on 05-07-2007 at 06:29 PM by Ashylay.
05-07-2007 06:28 PM
Profile E-Mail PM Find Quote Report
Chris4
Elite Member
*****

Avatar

Posts: 4461
Reputation: 84
32 / Male / Flag
Joined: Dec 2004
RE: Javascript Page Loading???
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.

.htm File Attachment: index.htm (533 bytes)
This file has been downloaded 231 time(s).

This post was edited on 05-07-2007 at 09:33 PM by Chris4.
Twitter: @ChrisLozeau
05-07-2007 09:14 PM
Profile PM Find Quote Report
Verte
Full Member
***

Avatar

Posts: 272
Reputation: 7
Joined: Apr 2007
RE: Javascript Page Loading???
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!
was put impeccably into words at DebianDay for me last Saturday, by Knut Yrvin of Trolltech - adults try something once, fail, and then are like "ffs this doesn't work". Children try, fail, and then try again, and succeed - maybe on the second, or even fifth retry. But the thing is that they keep at it and overcome the problems in the end.

-andrewdodd13
05-08-2007 04:01 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Javascript Page Loading???
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.
[Image: markee.png]
05-08-2007 04:28 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: Javascript Page Loading???
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
[Image: dt2.0v2.png]      Happy Birthday, WDZ
05-08-2007 04:28 AM
Profile PM Web Find Quote Report
Dennis Mike
Junior Member
**

Avatar

Posts: 59
Reputation: 2
33 / Male / –
Joined: Jan 2007
RE: Javascript Page Loading???
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>




05-08-2007 04:44 AM
Profile PM Web Find Quote Report
Verte
Full Member
***

Avatar

Posts: 272
Reputation: 7
Joined: Apr 2007
RE: RE: Javascript Page Loading???
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]
was put impeccably into words at DebianDay for me last Saturday, by Knut Yrvin of Trolltech - adults try something once, fail, and then are like "ffs this doesn't work". Children try, fail, and then try again, and succeed - maybe on the second, or even fifth retry. But the thing is that they keep at it and overcome the problems in the end.

-andrewdodd13
05-08-2007 05:18 AM
Profile E-Mail PM Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: Javascript Page Loading???
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 *-).
[Image: sig.png]
05-08-2007 07:07 AM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On