Recommended simple progress bar plug-in JQuery, jquery progress bar plug-in

Source: Internet
Author: User
Tags border image

Recommended simple progress bar plug-in JQuery, jquery progress bar plug-in

JQuery Progress Bar is a Progress Bar plug-in developed based on JQuery, adhering to JQuery's simple philosophy. Not only easy to use, but also easy to customize the appearance. For projects that use the JQuery framework, it is a good choice to use the progress bar control.

The JQuery Progress Bar is the same as the regular plug-in. You only need to use the selector to select an HTML element and directly call the open method of the plug-in. It provides the public method named progressBar (). Then, when there is an element with the id of progress1 on the HTML page, you can initialize the control as follows:

$ ("# Progress1"). progressBar ();

Its constructor can receive parameters shown in the following table.

Methods and Parameters

Purpose

ProgressBar ()

Initialize a progress bar by default

ProgressBar (persent)

Initialize or update a progress bar by default, and set the percentage of progress bars to persent %.

ProgressBar (config)

Initialize a progress bar according to the settings specified in config. The percentage is 0%. Do not use this method to change the progress bar settings after initialization. Otherwise, the display may be abnormal.

ProgressBar (persent, config)

Initialize a progress bar according to the settings specified in config. The percentage is persent %. Do not use this method to change the progress bar settings after initialization. Otherwise, the display may be abnormal.

The config parameter is a hash object that contains the following attributes used to set the appearance characteristics of the progress bar.

Attribute

Purpose

Increment

Set the growth of each step of the progress bar. The default value is 2.

Speed

Set the speed of the Dynamic Sliding effect during progress bar initialization. The default value is 15. The larger the value, the slower the sliding speed.

ShowText

Set whether to display the percentage identifier text. The default value is true, indicating that the percentage text mark is displayed.

BoxImage

Set the border image. The default value is images/progressbar.gif. To customize the border, modify this attribute and point to the image to be used.

BarImage

Set the progress icon image. The default value is images/progressbg_green.gif. To customize the image, modify the attribute and point to the image to be used. This image is classified into two sections. The first half is used to identify the progress, and the last half is used to identify the remaining progress. The two sections are of the same length and are equal to the width of the progress bar.

Width

Set the width of the progress bar. This value must be consistent with the image pointed to by barImage and boxImage. The default value is 120.

Height

Set the height of the progress bar. This value must be consistent with the image pointed to by barImage and boxImage. The default value is 12.

The interaction with the server will not be discussed here, just use ajax to get the progress value from the server, and then use progressBar (persent) to update the progress.


For js or jquery progress bar implementation?

Write a div to define the width and height. A background image is placed below as a blank progress bar.
Add an img image to the div, which can be expanded left and right. Then, use JavaScript to dynamically control the image width to display the progress.

Jquery-126 progressbar how to use

JQuery Progress Bar is a Progress Bar plug-in developed based on JQuery, adhering to JQuery's simple philosophy.
Not only easy to use, but also easy to customize the appearance. For projects that use the JQuery framework,
This is a good choice when you need to use the progress bar control.

The JQuery Progress Bar is the same as the regular plug-in. You only need to use the selector to select an HTML element,
Directly call the public method of the plug-in. It provides the public method named progressBar ().
Then, when there is an element with the id of progress1 on the HTML page, you can initialize the control as follows:

$ ("# Progress1"). progressBar ();

Its constructor can receive parameters shown in the following table. Methods and Parameters
Purpose

ProgressBar ()
Initialize a progress bar by default

ProgressBar (persent)
Initialize or update a progress bar by default, and set the percentage of progress bars to persent %.

ProgressBar (config)
Initialize a progress bar according to the settings specified in config. The percentage is 0%. Do not use this method to change the progress bar settings after initialization. Otherwise, the display may be abnormal.

ProgressBar (persent, config)
Initialize a progress bar according to the settings specified in config. The percentage is persent %. Do not use this method to change the progress bar settings after initialization. Otherwise, the display may be abnormal.

The config parameter is a hash object that contains the following attributes used to set the appearance characteristics of the progress bar.

Attribute
Purpose

Increment
Set the growth of each step of the progress bar. The default value is 2.

Speed
Set the speed of the Dynamic Sliding effect during progress bar initialization. The default value is 15. The larger the value, the slower the sliding speed.

ShowText
Set whether to display the percentage identifier text. The default value is true, indicating that the percentage text mark is displayed.

BoxImage
Set the border image. The default value is images/progressbar.gif. To customize the border, modify this attribute and point to the image to be used.

BarImage
Set the progress icon image. The default value is images/progressbg_green.gif. To customize the image, modify the attribute and point to the image to be used. This image is classified into two sections. The first half is used to identify the progress, and the last half is used to identify the remaining progress. The two sections are of the same length and are equal to the width of the progress bar.

Width
Set the width of the progress bar. This value must be consistent with the image pointed to by barImage and boxImage. The default value is 120.

Height
Set the height of the progress bar. This value must be consistent with the image pointed to by barImage and boxImage. The default value is 12.

$ (Document). ready (function (){
$ ("# Spaceused1"). progressBar ();
$ ("# Spaceused2"). progressBar ({barImage: 'images/progressbg_yellow.gif '});
$ ("# Spaceused3"). progressBar ({barImage: 'images/progressbg_orange.gif ', showText: false });
$ ("# Spaceused4"). progressBar (65, {showText: false, barImage: 'images & #47 ...... remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.