영카트 icon이 세개이상이면 text-align center를 주는방법이 뭐가있을까요?
본문
영카트 list.10.skin.php에 있는 코드인데요
if ($this->view_it_icon) {
echo "<div class=\"sct_icon\">".item_icon3($row)."</div>\n";
}
sct_icon 안에 있는 img개수를 세어서 3개이상이면 .sct_icon클래스에다가 속성을주고싶은데
포문으로 돌고있는터라 어디서 캐치해야할지 모르겠습니다.
$(".sit_icon").children("img").length; 이런식으로 개수를 가져오고싶지만 현존하는 이미지 개수를 다가져와서 문제네요
조언좀 주시면 감사하겠습니다!
!-->답변 1
for 문을 이용한다면 각각의 id 를 주시면 안될까요?
<div class=\"sct_icon\" id=\"sct_icon_FOR변수\">
이런식으로 해서
$("#sit_icon_FOR변수").children("img").length;
답변을 작성하시기 전에 로그인 해주세요.