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
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help!! How can i do this? Plz read this.....

    Hi to all of you there.

    i want to ask you something and it goes like that........

    When we open a site, the page takes some to get load and wat i want is to display a user defined msg or the progress bar for that much time on the screen for all the pages in the website. plz do keep in mind that not after the page load i need it for before the page loads.

    Waiting For your Replies................

    Thanking You,
    Lovely

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Do please read the posting guidelines about silly thread titles and incoherent questions.

    Try this:-

    <p>Displays progress bar in status bar and/or in a div in the page as required.</p>

    <p><font color = #FF0000"></p>
    <div id = "pbar"></div></font>

    <script type = "text/javascript">
    var percent = 10; // adjust starting value to suit
    var timePeriod = 100; // adjust milliseconds to suit

    function getBar() {
    var retBar = '';
    for (i = 0; i < percent; i++) {
    retBar += "|";
    }
    return retBar;
    }

    function progressBar() {
    if (percent < 100) {
    percent = percent + 1;
    document.getElementById("pbar").innerHTML = "&nbsp &nbsp &nbsp &nbsp Loading : " + percent + "%" + " " + getBar();
    window.status = "Loading : " + percent + "%" + " " + getBar();
    setTimeout ("progressBar()", timePeriod);
    }
    else {
    document.getElementById("pbar").innerHTML = "";
    window.status = "Your message here";
    document.body.style.display = "";
    }
    }
    progressBar();
    </script>


    It is your responsibility to die() if necessary… - PHP Manual

  • #3
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks sir for this reply, and sorry from my side too for the reason being i havent quoted completely wat i want.
    so here it goes..

    Adding to wat i hav written earlier is: I want to use this code in my Dot Net Website and with a condition that the time for which the progress bar or the msg is there the person would not be able to click on any control of the page getting loaded.
    So if this time you are able to help me. I will b thankful to you for this.

    Thanks Once Again.
    Lovely.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    I can only suugest that on every control or link you add

    onclick = "waitForIt()"

    and add to the script

    function waitForIt() {
    if (percent <100) {
    alert ("Please wait for the page to complete loading!);
    return false;
    }
    }

    BTW, the time to say "thanks" is afterwards, not before when the word "please" is usually considered polite. If you find this response helpful then please use the "Thank You For This Post" button.


  •  

    Posting Permissions

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