标签:div remove dex nbsp tar box his bsp find
<div class="starbox">
<i class="iconfont icon-star1"></i>
<i class="iconfont icon-star1"></i>
<i class="iconfont icon-star1"></i>
<i class="iconfont icon-star1"></i>
<i class="iconfont icon-star1"></i>
</div>
$(function(){
var starbox = $(".starbox");
starbox.find(‘i‘).hover(function(e){
e.stopPropagation();
var index = $(this).index();
starbox.children(‘i:lt(‘+index+‘)‘).add(this).addClass(‘check‘);
starbox.children(‘i:gt(‘+index+‘)‘).removeClass(‘check‘);
});
});
标签:div remove dex nbsp tar box his bsp find
原文地址:http://www.cnblogs.com/freddyhuang/p/6193603.html