开发者

javascript based progress bar

开发者 https://www.devze.com 2022-12-19 16:04 出处:网络
I am curious how can a javascript (or also benefiting from jquery) based progress indicator such can be developed:

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

精彩评论

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

关注公众号