제이쿼리 호버 채택완료
ango
4년 전
조회 2,397
게시판 스킨 list.skin.php 를 수정하고 있습니다
첫번째 제목(aas)에 마우스를 올릴때만
바로 오른쪽의 N글자를 빨간색으로 하고 싶은데,
다른 제목에 마우스를 올려도, N글자가 빨간색으로 변합니다
제이쿼리를 어떻게 짜야 하나요?

</p>
<p>$(".bo_tit a").hover(function(){
$(".new_icon").css("color", "#f00");
}, function(){
$(".new_icon").css("color", "#fff");
});</p>
<p>

댓글을 작성하려면 로그인이 필요합니다.
답변 4개
채택된 답변
+20 포인트
4년 전
$(".bo_tit a").hover(function(){
$(this).find('.new_icon').css("color", "#f00");
}, function(){
$(this).find('.new_icon').css("color", "#fff");
});
또는
$(".bo_tit a").hover(function(){
$(this).children(".new_icon").css("color", "#f00");
}, function(){
$(this).children(".new_icon").css("color", "#fff");
});
$(this)와 .find(), .children() 에 대해서 검색해보시면 이해가 쉬우실거에요
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
4년 전
</p>
<p>$(".bo_tit a").hover(function(){
$(this).find(".new_icon").css("color", "#f00");
}, function(){
$(this).find(".new_icon").css("color", "#fff");
});</p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인