How do I stop automatic loading?

I’m trying to add this to a site: http://jqueryui.com/progressbar/#label but I only want it to load when a button is clicked rather than automatically and don’t know how to do that.

I tried changing it to:

progressbar.progressbar({
disabled: true,
value: false,
change: function() {
progressLabel.text( progressbar.progressbar( “value” ) + “%” );
}

but that didn’t work at all.

[quote=“coding_noobie, post:1, topic:221409, full:true”]
I’m trying to add this to a site: http://jqueryui.com/progressbar/#label but I only want it to load when a button is clicked rather than automatically and don’t know how to do that.[/quote]

I don’t think that you can create it and say that it’s disabled both at the same time.

After creating it, you can set disabled to be true like this:

progressbar.progressbar({"disabled": true});

Note: This doesn’t stop the progress bar from being shown. Instead it lowers its opacity to show that it’s currently disabled.

You can have a fiddle with this at https://jsfiddle.net/1t0cquo3/1/

Thanks but that’s not quite what I’m after. I want to stop it being created straightaway? I want to use it as part of a download process but at the moment it’s automatically starting as soon as the page has loaded rather than when somebody clicks download.

So essentially I want it to keep saying ‘loading’ until somebody clicks the download button

1 Like

Fantastic thank you, that works perfectly :slight_smile:

I know it’s slightly off topic but is it possible to also set the download percentage too? I have a script (in another js file) that works out the percentage that’s downloaded already and I’d ideally like that to be displayed on in the bar

The percentage value is in a function called progressDone and the value I want to get is this part of the function: var percentage = $.cookie(‘downloaded’);

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.