views:

99

answers:

3

I need circular progress indicator. Are there any plugins for this and if there is not, how should I implement this kind of plugin?

EDIT:

What I'm looking for is what jQuery UI has in their planning page, but its not yet implemented. I'm just curious if anyone has implemented this before. See item 6 in following image.

alt text

http://wiki.jqueryui.com/ProgressIndicator

+3  A: 

Like, one of these? You don't need a plugin for that. Just .show() and .hide() it as necessary (or insert it into the DOM, whatever floats your boat).

Mark
+1 - http://www.ajaxload.info/ is a great site.
Peter Ajtai
Sorry my question was maybe little too vague, but what I meant was what jUqery ui team is planning: http://wiki.jqueryui.com/ProgressIndicator see 2 - Visual design 6th item. That kind of circualr progress that tells how many precents are completed.
newbie
+1  A: 

You can simply toggle it when you make a request. Then when you finish the request restore to initial state.

A simple example on jsFiddle. I used toggle function, but you can use whatever animation you want.

BrunoLM
+1  A: 

Hey,

What are you loading? A basic example would be:

<div id="loading"></div>
<a href="javascript:void(0);" id="load">Load!</a>

<script type="text/javascript">
    $('#load').click(function(){ // click event on the load link
        $('#loading').html('<img src="/path/to/animation.gif" />'); // display a loading animation where the content goes
        $.get('/file/to/load.php', function(data) { // request content to be displayed
            $('#loading').html(data); // display content
        });
    });
</script>

Cheers

Claudiu
The href for `#load` should be `/path/to/animation.gif` and you should use `event.preventDefault()` in ` $('#load').click(...)`. - This way the page actually works meaningfully if the user has JS disabled.
Peter Ajtai
So, you say that if the user clicks the load link and sees the animation (the actual .gif) if he has JS disabled, that's meaningfull? javascript:void(0) seems to work very well, even in YouTube's API examples... I think it's better doing nothing than leading to an animated gif.
Claudiu