[Help] Меню, аккордеон на Java + html

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

TranceFM

Постоялец
Регистрация
3 Фев 2009
Сообщения
70
Реакции
2
Есть меню, построено на ява+хтмл, все ок. Однако есть проблемма, когда пользователь расскрывает меню, и переходить на страничку по ссылке с меню, то при загрузке новой странички, меню опять сворачиваеться.

Вод код меню:
PHP:
<script language="JavaScript" type="text/javascript">
if (document.getElementById) {
 document.writeln('<style type="text/css"><!--')
 document.writeln('.links {display:none; padding-left:14px}')
 document.writeln('.link {text-decoration:none;}')
 document.writeln('a:hover.link {text-decoration: none;')
 document.writeln('//--></style>') }
function openClose(theID) {
 if (document.getElementById(theID).style.display == "block") {
     document.getElementById(theID).style.display = "none";
     document.getElementById("tick_"+theID).innerHTML = "+"; }
 else {
     document.getElementById(theID).style.display = "block";
     document.getElementById("tick_"+theID).innerHTML = "-"; } }
</script>

<table border="0" width="250" bgcolor="#ffffff" cellpadding="2" cellspacing="0">
   <tr>
   <tr><td bgcolor="#ffffff" style="font-family:arial, helvetica, sans-serif; font-size:9pt; color: blue; line-height: 16pt">
      <div onClick="openClose('a2')" style="cursor:hand; cursor:pointer"><span id="tick_a2">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">Menu1</span></div>
      <div id="a2" class="links"> 
      <a href="http://#" class="link">1</a><br />
        <a href="http://#" class="link">2</a><br />
        <a href="http://#" class="link">3</a><br />
        <br />
      </div>
      <div onClick="openClose('a1')" style="cursor:hand; cursor:pointer"><span id="tick_a1">+</span><span style="color: #000">Menu2</span></div>
      <div id="a1" class="links">
       <div onClick="openClose('b1')" style="cursor:hand; cursor:pointer"><span id="tick_b1">+</span><span style="color: #000">--1</span></div>
       <div id="b1" class="links">
         <a href="http://#" class="link">1</a><br />
        <a href="http://#" class="link">2</a></div>
       <div onClick="openClose('b2')" style="cursor:hand; cursor:pointer"><span id="tick_b2">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">--2</span></div>
       <div id="b2" class="links"> 
         <a href="http://#" class="link">1</a><br />
         <a href="http://#" class="link">2</a><br />
         <a href="http://#" class="link">3</a><br />
         <br />
       </div>
       <div onClick="openClose('b3')" style="cursor:hand; cursor:pointer"><span id="tick_b3">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">--3</span></div>
       <div id="b3" class="links"> <a href="http://#" class="link">1</a><br />
         <a href="http://#" class="link">2</a><br />
         <a href="http://#" class="link">3</a><br />
         <br />
       </div>
      </div></td></tr>
  </table>

Подскажите, как сделать так, что бы при переходе на новую страницу из меню, само меню не закрывалось?
Заранее спасибо.
 
Есть меню, построено на ява+хтмл, все ок. Однако есть проблемма, когда пользователь расскрывает меню, и переходить на страничку по ссылке с меню, то при загрузке новой странички, меню опять сворачиваеться.
Вод код меню:
PHP:
<script language="JavaScript" type="text/javascript">
if (document.getElementById) {
 document.writeln('<style type="text/css"><!--')
 document.writeln('.links {display:none; padding-left:14px}')
 document.writeln('.link {text-decoration:none;}')
 document.writeln('a:hover.link {text-decoration: none;')
 document.writeln('//--></style>') }
function openClose(theID) {
 if (document.getElementById(theID).style.display == "block") {
     document.getElementById(theID).style.display = "none";
     document.getElementById("tick_"+theID).innerHTML = "+"; }
 else {
     document.getElementById(theID).style.display = "block";
     document.getElementById("tick_"+theID).innerHTML = "-"; } }
</script>
<table border="0" width="250" bgcolor="#ffffff" cellpadding="2" cellspacing="0">
   <tr>
   <tr><td bgcolor="#ffffff" style="font-family:arial, helvetica, sans-serif; font-size:9pt; color: blue; line-height: 16pt">
      <div onClick="openClose('a2')" style="cursor:hand; cursor:pointer"><span id="tick_a2">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">Menu1</span></div>
      <div id="a2" class="links"> 
      <a href="http://#" class="link">1</a><br />
        <a href="http://#" class="link">2</a><br />
        <a href="http://#" class="link">3</a><br />
        <br />
      </div>
      <div onClick="openClose('a1')" style="cursor:hand; cursor:pointer"><span id="tick_a1">+</span><span style="color: #000">Menu2</span></div>
      <div id="a1" class="links">
       <div onClick="openClose('b1')" style="cursor:hand; cursor:pointer"><span id="tick_b1">+</span><span style="color: #000">--1</span></div>
       <div id="b1" class="links">
         <a href="http://#" class="link">1</a><br />
        <a href="http://#" class="link">2</a></div>
       <div onClick="openClose('b2')" style="cursor:hand; cursor:pointer"><span id="tick_b2">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">--2</span></div>
       <div id="b2" class="links"> 
         <a href="http://#" class="link">1</a><br />
         <a href="http://#" class="link">2</a><br />
         <a href="http://#" class="link">3</a><br />
         <br />
       </div>
       <div onClick="openClose('b3')" style="cursor:hand; cursor:pointer"><span id="tick_b3">+</span> <span style="color:#000;" onMouseOver="this.style.color='##00C';this.style.textDecoration='none';" onMouseOut="this.style.color='#000';this.style.textDecoration='none';">--3</span></div>
       <div id="b3" class="links"> <a href="http://#" class="link">1</a><br />
         <a href="http://#" class="link">2</a><br />
         <a href="http://#" class="link">3</a><br />
         <br />
       </div>
      </div></td></tr>
  </table>
Подскажите, как сделать так, что бы при переходе на новую страницу из меню, само меню не закрывалось?
Заранее спасибо.

яваскрипт а не ява.

делал недавно на asp.net такое, с radpanelbar (telerik rad controls)
сравнивать адрес ссылки из меню с адресом текущей страницы в браузере и если название совпадает то раскрывать панель с этой ссылкой.
 
Спасибо конечно, но это не на asp.net, и я в этом профан, по этому хотелось бы, что бы знающие, поделились фиксом кода, или поделились аналогичным.
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху