회원 정보 레이어를 사용하려고 하는데요..

· 12년 전 · 947 · 1
캡처.JPG
기존 그누보드에 있는거 말고 제이쿼리로 간단하게 쓰려고 했는데...
같은 아이디를 클릭하면 레이어가 나오고 다시 클릭하면 사라지긴 하는데...
문제가...1번 아이디를 클릭하고서 2번 아이디를 클릭히면 1번 레이어는 사라져야 하는데
계속 떠 있다는거에요 ㅠ

<script>
function viwe_viwe(idx){
var unit = $('.profile'+[idx]);
var that = $('.friend_list'+[idx]);

if(that.hasClass("on")){
that.removeClass("on");
$('.profile'+[idx]).hide();
}else{
that.addClass("on");
$('.profile'+[idx]).show();
unit.css("display","block");
}


}
</script>

요게 제이쿼리인데..

본문은
<span class="friend_list<?=$profile_ii?>" onclick="viwe_viwe('<?=$profile_ii?>');"><?=$rs[mb_nick]?></span>
<ul class="profile<?=$profile_ii?>">
</ul>

이거든요

한눈에 봐도 뭐가 문제인지는 알겠는데...(다른 아이디를 클릭했을때의 이벤트 처리가 없으니...)
제이쿼리를 잘 몰라서 손을 못대겠어요...ㅠ

첨부파일

캡처.JPG (14.4 KB)
0회 2013-09-26 10:59
|

댓글 1개

[code]
<script>
function viwe_viwe(idx){
$('.profile').hide();
var unit = $('.profile'+[idx]);
var that = $('.friend_list'+[idx]);

if(that.hasClass("on")){
that.removeClass("on");
$('.profile'+[idx]).hide();
}else{
that.addClass("on");
$('.profile'+[idx]).show();
unit.css("display","block");
}


}
</script>

<span class="friend_list<?=$profile_ii?>" onclick="viwe_viwe('<?=$profile_ii?>');"><?=$rs[mb_nick]?></span>
<ul class="profile<?=$profile_ii?> profile">
</ul>
[/code]

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고