开发者

javascript based progress bar

I am curious how can a javascript (or also benefiting from jquery) based progress indicator such can be developed:

alt text http://img707.imageshack.us/img707/3295/dealindicator.png

My first idea is something such as:

function drawBar(total,sofar){
.........................

}

where it consumes 开发者_运维技巧the max number(20 in our case) and sofar (15 for the picture).

But how can it be implemented?

Is there any jquery based plugin to achieve this?

Regards


This is usually done with CSS, by creating a div the total size of your progressbar, and then having another div child of that which has a percentage width of how much needs to be filled.

You can style the divs anyway you want. You likely want to style the inner div with background-color, or background-image & background-repeat. It can be a solid colour, a gradient, or a banded pattern, which seems to be rather popular.

Have you Google'd for jQuery plugins? They are fairly easy to find. Here's one for example: http://t.wits.sg/jquery-progress-bar/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜