Introduction to progress bar rendering in layui

Release: 2020-02-12 16:14:15
forward
6120 people have browsed it

Introduction to progress bar rendering in layui

Consider two situations: static rendering and dynamic rendering of progress bars.

 
Copy after login

With the above code alone, the progress bar value cannot be displayed.

(1) Static rendering

The progress bar depends on the element component. If it is not introduced, the progress bar will not be displayed.

layui.use('element', function () {
    var element = layui.element;
});
Copy after login

At this time, the progress bar displays the following results:

Introduction to progress bar rendering in layui

(2) Dynamic rendering

When you need to dynamically change the progress value of the progress bar , layui official website says that the element module provides the basic method of element.progress().

First set the progress bar filter (lay-filter="demo"), and then you only need to execute this method in an event or statement to dynamically change the precision bar value. But for the percentage text displayed in the accuracy bar, users need to change it themselves.

element.progress('demo', '80%');
Copy after login

At this time the progress bar value changes:

Introduction to progress bar rendering in layui

For more layui knowledge, please pay attention to the layui usage tutorial column.

The above is the detailed content of Introduction to progress bar rendering in layui. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!