为了账号安全,请及时绑定邮箱和手机立即绑定

星星評價怎麼做?

星星評價怎麼做?

鸿蒙传说 2019-05-23 11:36:09
$(".bstar1").mouseenter(function(e){$('.bstar1').prop('src','images/star.png');});就是指標在哪裡,黃星星就會補滿bstar是灰的star是黃的我越寫越不對,這樣好像不通?怎麼寫才對?_____________________________更新我寫這樣$('.rate_bstar').hover(function(){$(this).prevAll().prop('src','images/star.png');$(this).prop('src','images/star.png');$(this).nextAll().prop('src','images/bstar.png');},function(){$(this).prevAll().prop('src','images/bstar.png');$(this).prop('src','images/bstar.png');$(this).nextAll().prop('src','images/bstar.png');});發現這樣可以,但我點擊後我想讓他停在那個狀態,不要消失
查看完整描述

2 回答

?
SMILET

TA贡献1796条经验 获得超4个赞

$("#startImg").on("click",'img',a)
$('#startImgimg').hover(a,b);
functiona(){
$(this).attr('src','images/star.png')
$(this).prevAll().attr('src','images/star.png')
$(this).nextAll().attr('src','images/bstar.png');
}
functionb(){
$('#startImgimg').attr('src','images/bstar.png');
}
                            
查看完整回答
反对 回复 2019-05-23
?
回首忆惘然

TA贡献1847条经验 获得超11个赞

$(".rate_bstar").mouseenter(function(e){
$(this).attr('src','images/star.png').prevAll().attr('src','images/star.png');
});
鼠标离开的时候全部改回来就行了。
                            
查看完整回答
反对 回复 2019-05-23
  • 2 回答
  • 0 关注
  • 337 浏览
慕课专栏
更多

添加回答

了解更多

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号