可以自由更换样式的进度条效果,如果不需要动画效果只需要CSS3即可,只需要简单的代码即可手动控制进度显示的比例,非常实用的效果。
javascript代码,分别标识4种不同百分比的进度条:
[code]
<script>
$(document).ready(function(){
$('.quarter').click(function(){
$(this).parent().prev().children('span').css('width','25%');
});
$('.half').click(function(){
$(this).parent().prev().children('span').css('width','50%');
});
$('.three-quarters').click(function(){
$(this).parent().prev().children('span').css('width','75%');
});
$('.full').click(function(){
$(this).parent().prev().children('span').css('width','100%');
});
});
</script>
[/code]

本文系作者在时代Java发表,未经许可,不得转载。
如有侵权,请联系nowjava@qq.com删除。