Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6651137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:58:29+00:00 2026-05-26T00:58:29+00:00

I have a jQuery UI progressbar that acts as a timer. However when I

  • 0

I have a jQuery UI progressbar that acts as a timer. However when I open the page, all it has is "Loading…" (added in html) and nothing else.

Links to files

HTML file: http://pastebin.com/Re0ZKVNY

Javascript file: http://pastebin.com/zynA5MnY

I can’t seem to find anything wrong with the code. Tried copy & pasting code from the jQuery UI demos, but nothing seems to make it work (with my code.).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:58:29+00:00Added an answer on May 26, 2026 at 12:58 am

    It seems that you’re doing a few things wrong:

    • you’re trying to use jQuery UI Progressbar widget yet you’re setting your progress bar’s width using CSS (which actually manipulates usual HTML DIV element
    • some of your code executes immediately and some on ready event

    This is some simplified example that doesn’t use jQuery UI Progress bar but rather a custom solution the way that you actually use.

    But basically let me also modify you code and move everything where it belongs:

    // Progressbar Stuff
    $(function() {
        /* don't need this
        $( "#loading" ).progressbar({
            value: 0
        });
        */
    
        //increment progressbar
        var loading = $('#loading');
        width = 0; //loading.width();
    
        var interval = setInterval(function() {
    
            width++;
            loading.width(width + '%');
    
            if (width >= 100) {
                clearInterval(interval);
                loadContent();
            }
        }, 75);
    
    
        // Fade Out, load content, fade in.
        function loadContent() {
          $("#loadcontent").fadeOut("slow", function(){
            $("#content").load("./content/main.html",false, function() {
              $("#content").fadeIn("slow");
            });
          })
        }
    
    });
    

    Alternative

    Since it seems that all you’re doing in your interval is animate progress bar it seems reasonable to just let jQuery do the animation instead. And since you’re incrementing your progress bar every 75ms and it takes 100 steps until you load content, you should run your animation for 7500ms then. It also makes progress bar run smoother.

    $(function() {
        // animate progress bar
        $("#loading").width(0).animate(
            {
                width: "100%" // animate what
            },
            75 * 100, // for how long (100 steps per 75ms)
            "linear", // how to animate it
            function() { // what to do afterwards
                // replace with your own functionality
                alert("Load content");
            }
        );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have jquery code like this: html += '<div class=index>' + item.index +
I have some jQuery/JavaScript code that I want to run only when there is
I have a jQuery datepicker that I want to restrict non work days -
I have some jQuery code. I have called an Ajax function file, file.php, that
I have this jQuery code that queries an API on a keyup event (via
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file
I'd like to have a jQuery progress bar that updates based on the status
I have heavy HTML-page with several megabytes of images and scripts. I'd like to
I have a Photoshop mockup that has some customized buttons and inputs and I
I'm struggling to find the right terminology here, but if you have jQuery object...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.