Easyui Series Learning (eight)-progressbar (progress bar)

Source: Internet
Author: User

First, create the component

1.class loading

<class= "Easyui-progressbar"></div>

2.js loading

<DivID= "PB"></Div><Script>    $(function () {        $("#pb"). ProgressBar (); })</Script>

Second, the attribute

<DivID= "PB"></Div><Script>    $(function () {        $("#pb"). ProgressBar ({//progress bar width, default autoWidth:" -",            //progress bar height, default toHeight: -,            //progress bar value, default is 0Value: -,            //set the progress bar percent templateText:"{value}%"        }); })</Script>

The generated HTML

<DivID= "PB"class= "ProgressBar"style= "width:398px; height:28px;">    <Divclass= "Progressbar-text"style= "width:398px; height:28px; line-height:28px;">60%</Div>    <Divclass= "Progressbar-value"style= "width:60%; height:28px; line-height:28px;">        <Divclass= "Progressbar-text"style= "width:398px; height:28px; line-height:28px;">60%</Div>    </Div></Div>

III. Events

OnChange: Triggered when a value is changed

<DivID= "PB"></Div><Script>    $(function () {        $("#pb"). ProgressBar ({value: -, OnChange:function(NewValue, OldValue) {Console.log ("NEW:" +NewValue+ ", old:" +oldValue);        }        }); SetTimeout (function () {            $("#pb"). ProgressBar ("SetValue",  -); },  +); SetInterval (function () {            $("#pb"). ProgressBar ("SetValue", $("#pb"). ProgressBar ("GetValue") + 5); },  +); })</Script>

Iv. methods

1.options

<DivID= "PB"></Div><Script>    $(function () {        $("#pb"). ProgressBar ({}); Console.log ($ ("#pb"). ProgressBar ("Options")); })</Script>

Results of the output

2.resize

<DivID= "PB"></Div><Script>    $(function () {        $("#pb"). ProgressBar ({value: -        }); //Set Component Length        $("#pb"). ProgressBar ("Resize", " -"); })</Script>

3.getvalue,setvalue

V. Setting default values

$.fn.progressbar.defaults.value = 60;

Easyui Series Learning (eight)-progressbar (progress bar)

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.