вопрос по меню

Статус
В этой теме нельзя размещать новые ответы.

vilk108

Профессор
Регистрация
17 Дек 2007
Сообщения
174
Реакции
39
ношел такое меню, и меня интерисует как сделать так чтобы оно не закрывалось при нажатие на текст - вкладка 1 или на текст вкладка 2(вкладка 1 и вкладка 2 это пункты меню)
<script >
function treeExpand(trname) {
head = trname+'_h';
body = trname+'_b';
trh = document.getElementById(head);
trb = document.getElementById(body);
var b,h;
if (trh.style.display == 'none')
{ h = 'none';
b= 'block';}
else
{ h = 'block';
b = 'none';}
trh.style.display = b;
trb.style.display = h;
return true;
}
</script>

<div id='tr_2_h' onClick="treeExpand('tr_2')" style="cursor:hand" class='menu_head_unactive'>
+ меню</div>
<div id='tr_2_b' onClick="treeExpand('tr_2')" style="cursor:hand; display:none;" class='menu_head_active'>
- меню
<table border=0>
<tr><td>
<ul style="menu">
<li class="menus">вкладка 1</li>
<li class="menus">вкладка 2</li>
</ul></td></tr>
</table>
</div>
 
Ответ на Ваш вопрос:

HTML:
<script >
function treeExpand(trname) {
head = trname+'_h';
body = trname+'_b';
trh = document.getElementById(head);
trb = document.getElementById(body);
var b,h;
if (trh.style.display == 'none')
{ h = 'none';
b= 'block';}
else
{ h = 'block';
b = 'none';}
trh.style.display = b;
trb.style.display = h;
return true;
}
</script>

<div id='tr_2_h' style="cursor:hand" class='menu_head_unactive'>
<p onClick="treeExpand('tr_2')">+ меню</p></div>
<div id='tr_2_b' style="cursor:hand; display:none;" class='menu_head_active'>
<p onClick="treeExpand('tr_2')">- меню</p>
<table border=0>
<tr><td>
<ul style="menu">
<li class="menus">вкладка 1</li>
<li class="menus">вкладка 2</li>
</ul></td></tr>
</table>
</div>
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху