사이트 내 전체검색
tab 으로 사용할때 mouseover 주의할점
로빈아빠
https://cmd.kr/javascript/816 URL이 복사되었습니다.

본문

<a href="javascript:show_tab(1);" class="tab tit tit1 tabTit1">공지사항</a>

<div id='tabId1' class="tabCon" style="display:">

<ul>

<?

echo latest("ar.nude", 'akom11', 5, 35);

?>

</ul>

<a href="/bbs/board.php?bo_table=akom11" class="more"><img src="/img_new/btn_more.gif" alt="더보기"></a>

</div>

 

<a href="javascript:show_tab(2);" class="tab tit tit1 tabTit2">회원 경조사</a>

<div id='tabId2' class="tabCon" style="display:none">

<ul>

<?

echo latest("ar.nude", 'akom19', 5, 30);

?>

</ul>

<a href="/bbs/board.php?bo_table=akom19" class="more"><img src="/img_new/btn_more.gif" alt="더보기"></a>

</div>

 

<script>

function show_tab(no) {

for(j=1; document.getElementById('tabId'+j); j++) {

if (j==no) jQuery('#tabId'+j).show();

else jQuery('#tabId'+j).hide();

}

}

 

// 안되는 루틴

<? if (is_mobile()) { ?>

for(j=1; document.getElementById('tabId'+j); j++) {

$("#tabTit"+j).mouseover(function() {show_tab(j);});

}

<? } ?>

 

 

// 정상동작하는 루틴

<? if (is_mobile()) { ?>

$("#tabTit1").mouseover(function() {show_tab(1);});

$("#tabTit2").mouseover(function() {show_tab(2);});

<? } ?>

 

현재 위치의 class 명으로 파악해서 show_tab(j) 로 뿌리는것은 가능할듯함..

 

댓글목록

등록된 댓글이 없습니다.

831 (1/17P)

Search

Copyright © Cmd 명령어 3.144.86.134