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

Copy
$(".bo_tit a").hover(function(){
$(".new_icon").css("color", "#f00");
}, function(){
$(".new_icon").css("color", "#fff");
});

답변 4개
채택된 답변
+20 포인트
2021-01-26 (화) 09:25:05
Copy
$(".bo_tit a").hover(function(){
$(this).find('.new_icon').css("color", "#f00");
}, function(){
$(this).find('.new_icon').css("color", "#fff");
});
또는
Copy
$(".bo_tit a").hover(function(){
$(this).children(".new_icon").css("color", "#f00");
}, function(){
$(this).children(".new_icon").css("color", "#fff");
});
$(this)와 .find(), .children() 에 대해서 검색해보시면 이해가 쉬우실거에요
레이첼AW
2021-01-26 (화) 15:36:15
잘됩니다. 답변 감사합니다.
2021-01-26 (화) 09:22:10
Copy
$(".bo_tit a").hover(function(){
$(this).find(".new_icon").css("color", "#f00");
}, function(){
$(this).find(".new_icon").css("color", "#fff");
});
병원에서일해요
2021-01-26 (화) 09:18:49
$(this).find(".new_icon").css
답변을 작성하려면 로그인이 필요합니다.