简体   繁体   English

如何制作进度条/容器?

[英]How to make a Progress bar/Container?

I am creating a website that involves people depositing items into the site, there will be a cap at 100 items. 我正在创建一个网站,涉及到人们将物品存入该网站的情况,上限为100个物品。 I am looking for a progress bar, horizontal or vertical I don't really mind, that increases as items are deposited into the site. 我正在寻找一个进度栏,无论水平还是垂直,我都不介意,随着项目存放到站点中而增加。

For now I am in need of help to get the progress bar working, going from 0 - 100%. 目前,我需要帮助来使进度条正常工作,范围是0-100%。 I will worry about connecting the percentage of the progress bar and items deposited later. 我将担心连接进度条和以后存放的项目的百分比。

Thanks in advance! 提前致谢!

HTML5 has a element that does a very simple version of this. HTML5的元素对此做了非常简单的描述。

It is used as follows: 它的用法如下:

<progress value="22" max="100"></progress>

Documentation regarding this element is here 有关此元素的文档在这里

Browser support is rock solid according to CanIUseIt.com: 根据CanIUseIt.com,对浏览器的支持非常牢固:

HTML5 progress element is fully supported in the following browsers: Firefox 16+, Chrome 8+, Safari 6+ and Opera 11+. 以下浏览器完全支持HTML5进度元素:Firefox 16 +,Chrome 8 +,Safari 6+和Opera 11+。

You can use javascript or your favorite framework to dynamically update it, and css to style it. 您可以使用javascript或您喜欢的框架来动态更新它,并使用css对其进行样式设置。

If you are looking to make something a little more sexy, there are numerous tutorials on the subject. 如果您想做些性感的事情,有很多关于该主题的教程。 Here is one I like. 这是我喜欢的一个。

Let me know if you need any more help. 让我知道您是否需要更多帮助。 Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM