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

Javascript Page Loading???
Author: Message:
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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Javascript Page Loading??? - by Ashylay on 05-07-2007 at 06:25 PM
RE: Javascript Page Loading??? - by hmaster on 05-07-2007 at 06:27 PM
RE: Javascript Page Loading??? - by Ashylay on 05-07-2007 at 06:28 PM
RE: Javascript Page Loading??? - by Chris4 on 05-07-2007 at 09:14 PM
RE: RE: Javascript Page Loading??? - by Ashylay on 05-09-2007 at 06:36 PM
RE: RE: RE: Javascript Page Loading??? - by Verte on 05-10-2007 at 04:11 AM
RE: RE: RE: RE: Javascript Page Loading??? - by Just-one on 07-03-2007 at 11:56 PM
RE: RE: RE: RE: RE: Javascript Page Loading??? - by Verte on 07-04-2007 at 09:54 AM
RE: RE: RE: RE: RE: RE: Javascript Page Loading??? - by rav0 on 08-18-2007 at 04:21 AM
RE: RE: RE: RE: RE: RE: RE: Javascript Page Loading??? - by Verte on 08-18-2007 at 04:34 PM
RE: Javascript Page Loading??? - by Verte on 05-08-2007 at 04:01 AM
RE: Javascript Page Loading??? - by markee on 05-08-2007 at 04:28 AM
RE: Javascript Page Loading??? - by -dt- on 05-08-2007 at 04:28 AM
RE: RE: Javascript Page Loading??? - by Verte on 05-08-2007 at 05:18 AM
RE: Javascript Page Loading??? - by Dennis Mike on 05-08-2007 at 04:44 AM
RE: Javascript Page Loading??? - by hmaster on 05-08-2007 at 07:07 AM
RE: RE: Javascript Page Loading??? - by Verte on 05-08-2007 at 11:14 AM
RE: Javascript Page Loading??? - by roflmao456 on 07-05-2007 at 01:54 AM


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