+ Reply to Thread
Results 1 to 4 of 4

Thread: Handy Loading script

  1. #1
    HabSite is offline x10Hosting Member HabSite is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    14

    Post Handy Loading script

    Handy Javascript Code:

    Here we will start with the header
    Code:
    <style type="text/css">
    <!--
    .subtitle {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: bold;
        text-transform: uppercase;
        color: #00A5E9;
        text-decoration: none;
    }
    .subsectiontitle {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-style: italic;
        font-weight: bold;
        text-transform: uppercase;
        color: #00A5E9;
        text-decoration: none;
    }
    .content {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-style: normal;
        font-weight: normal;
        color: #333333;
        text-decoration: none;
    }
    .anchor {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-style: normal;
        font-weight: normal;
        font-variant: normal;
        color: #4778BD;
        text-decoration: none;
    }
    .style1 {font-size: 12px; font-style: normal; color: #333333; text-decoration: none; font-family: Arial, Helvetica, sans-serif;}
    -->
    </style>
    And now we start with the style of the page, call this loading.css
    Code:
    html, body {
      margin:0px;
      padding:0px;
      overflow:auto;
      height:100%;
    }
    
    #loading-mask{
        top:0px;left:0px;
        width:100%;
        height:100%;
        background:#c3daf9;
        position:absolute;
        z-index:20000;
    }
    
    #loading{
        position:absolute;
        left:45%;
        top:40%;
        border:1px solid #6593cf;
        padding:2px;
        background:#c3daf9;
        width:150px;
        text-align:center;
        z-index:20001;
    }
    
    #loading .loading-indicator{
        border:1px solid #a3bad9;
        background:white url(load-bg.gif) repeat-x;
        color:#003366;
        font:bold 13px tahoma,arial,helvetica;
        padding:10px;
        margin:0;
        text-align:left;
    }
    Now the Javascript code call this loading.js
    Code:
    var LoaderInstance=function(){var rtnObj={},timer=100;function _addEvent(obj,evt,fnt,args){if(obj.addEventListener){obj.addEventListener(evt,function(){fnt.call(this,args);},false);}else if(window.attachEvent){obj.attachEvent('on'+evt,function(){fnt.call(this,args);});}else{obj['on'+evt]=function(){fnt.call(this,args);};}};function _closeLoader(elemName){var elem,elemArr=[],op=100,opF=1,stl,ua=navigator.userAgent.toLowerCase(),isIE=(ua.indexOf('opera')==-1&&ua.indexOf('msie')>-1);function _setStyle(elem,stl,key,val){for(var i=0;i<key.length;i++){if(isIE){stl[key[i]]=val[i];}else{stl=(stl)?stl+key[i]+':'+val[i]+';':key[i]+':'+val[i]+';';}}return stl;};function _transform(){var stl,elemBody;for(var i=0;i<elemArr.length;i++){stl=_setStyle(elemArr[i].elemObj,elemArr[i].elemStl,['filter','opacity','-moz-opacity'],['alpha(opacity='+op+')',opF,opF]);elemArr[i].elemObj.setAttribute('style',stl,true);}if(op>0){op-=10;opF='.'+(op/10)%100;setTimeout(function(){_transform();},timer);}else{for(var i=0;i<elemArr.length;i++){elemArr[i].elemObj.parentNode.removeChild(elemArr[i].elemObj);}}};for(var i=0;i<elemName.length;i++){elem=document.getElementById(elemName[i]);if(elem){stl=elem.getAttribute('style',true);elemArr=elemArr.concat({elemObj:elem,elemStl:stl});}}if(elemArr.length>0){_transform();}};rtnObj.closeLoader=_closeLoader;_addEvent(window,'load',function(){rtnObj.closeLoader(['loading-mask','loading']);});return rtnObj;}();
    Now to do the rest of the code
    Code:
        <link rel="stylesheet" type="text/css" href="loading.css" />
    </head>
    
    <body>
      <div id="loading-mask"> </div>
      <div id="loading">
        <div class="loading-indicator"><img src="loading.gif" style="width:16px;height:16px;" align="absmiddle" alt="" /> <Loading Message here.> </div>
      </div>
    <script type="text/javascript" src="loading.js"></script>  
    </head><body><?php include(yourfile.php); // please note iframes will screw up on this.<br />
    <br />
    <br />
    ?>
    <br />
    <br />
    Text here if you dont want to use php include.
    </body>
    and last of all the loading image.


    Included is the script. for more handy codes visit HERE.
    Attached Files

  2. #2
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Handy Loading script

    A demo page would be nice, along with an explanation

  3. #3
    HabSite is offline x10Hosting Member HabSite is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    14

    Re: Handy Loading script

    Demo Page is located at http://58.104.115.95/

  4. #4
    Laughing4life is offline x10 Sophmore Laughing4life is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    145

    Re: Handy Loading script

    He got suspended lol
    LINK TO MY SITE AND USERNAME
    www.nick.x10hosting.com
    USERNAME: Luigi
    PASSWORD= removed
    EMAIL TO CONTACT ME: Laughing4life@INBOX.com

    Thx admins

+ Reply to Thread

Similar Threads

  1. [OFF] Script Instillations (Now Accepting)
    By kryptonyte in forum The Marketplace
    Replies: 0
    Last Post: 08-02-2006, 02:15 AM
  2. Server UP time Script
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-03-2006, 04:39 PM
  3. Just a question about my script
    By rubens in forum Free Hosting
    Replies: 11
    Last Post: 02-28-2006, 01:41 PM
  4. CGI - script, Advertisement _HELP.
    By kaliforna in forum Free Hosting
    Replies: 12
    Last Post: 06-02-2005, 06:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers