jquery换一批的写法
<img src="{$yuming}/images/3/huanyipi.png" alt="" currentindex="1" count="3" class="huanyipi">
$('.huanyipi').on('click',function () {
var currentindex=parseInt($(this).attr('currentindex'));
var count=parseInt($(this).attr('count'));
currentindex++;
if(currentindex>count){
currentindex=1;
}
$(this).attr('currentindex',currentindex);
$('.bufenlist').css('display','none');
$('.bufen'+currentindex).fadeIn();
})
点一次一次currentindex+1 来判断 就行了
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/18838.html