前言
快过年了,为了让网站带有春节的气息,,开发带有春节特色的进度条。
效果演示
使用说明
- 在项目中引入jquery、进度条插件,将如下代码加入页面head元素中。
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="https://dcs4569.github.io/js/farmer.progress.js"></script>
- 指定页面元素执行progress函数,则在元素后面添加进度条,代码如下:
//年年有鱼
$('#demo').progress({type:'fish'},function(){
width ++;
if(width < 10){
return 10;
}
return width;
});
//打运营
$('#demo').progress({type:'farmer&#