Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Loading bar

  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Location
    forums
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Loading bar

    I want a bar that will show a teal (00FFFF) loading bar that counts to 10, while displays a loading status in the status bar. I would like it to redirect the user to go from my splash to mainpage. Is this possible? Thanks.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The loading bar part is not hard to make, but there's a couple of questions I have:
    • do you want this on your splash page or on a page on its own?
    • do you want it to actually be loading the page in the background?


    Here's the code for the loading bar, with no document loading happening in the background:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <title>Untitled</title>
    </head>
    <body>
    
     <table cellspacing="0" cellpadding="0">
      <tbody>
       <tr>
        <td id="td_loading_1">&nbsp;</td>
        <td id="td_loading_2">&nbsp;</td>
        <td id="td_loading_3">&nbsp;</td>
        <td id="td_loading_4">&nbsp;</td>
        <td id="td_loading_5">&nbsp;</td>
        <td id="td_loading_6">&nbsp;</td>
        <td id="td_loading_7">&nbsp;</td>
        <td id="td_loading_8">&nbsp;</td>
        <td id="td_loading_9">&nbsp;</td>
        <td id="td_loading_10">&nbsp;</td>
       </tr>
       <tr>
        <td id="td_loading_display" colspan="10" align="center">&nbsp;</td>
       </tr>
      </tbody>
     </table>
     
     <script>
      var loading_counter = 1;
      increment_loading_bar();
      function increment_loading_bar() {
       if(loading_counter > 10) //stop the 'recursion'
        return;
    		
       var td_loading = document.getElementById('td_loading_'+loading_counter);
       td_loading.style.backgroundColor = '#00FFFF';
      	 
       var td_display = document.getElementById('td_loading_display');
       var new_display = document.createTextNode(loading_counter);
       td_display.replaceChild(new_display, td_display.lastChild);
    	 
       loading_counter++;
       setTimeout('increment_loading_bar();', 1000);
      }
     </script>
    
    </body>
    </html>
    Sadiq.

  • #3
    New to the CF scene
    Join Date
    Aug 2004
    Location
    forums
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    1. No
    2. Yes.
    Splash page is here and the website is here
    ﻠﻢﻚﻍﺶﺱﺸﻷﻼﯽﻬﻴ

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jewx2
    I want
    didn't realise these forums were for people to get others to code for them. thought we were all here to help one another sort coding problems, not to demand scripts from the rest.

    so, instead of saying "i want", surely you mean you'd like someone help YOU put together a script that would do what you want.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •