1
我有一個代碼相關here。我有相同的類名相同的錨鏈接。我的問題是,如何做到這一點,當我嘗試懸停'長文本'鏈接時不會影響其他人?下圖顯示,當我將錨點鏈接懸停在上方時,也會受到影響。JQuery Hover函數更改另一個
HTML
<a class="short-text">Short Text</a>
<a class="long-text">Long Text Here</a>
<a class="short-text">Short Text</a>
<a class="long-text">Long Text Here</a>
jQuery的
$(".long-text").hover(function(){
$('.short-text').css('color','orange')
},function(){
$('.short-text').css('color','black')
});