Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Dynamiczne zakładki - nie działają 2 panele na raz
Diego22
post
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 0
Dołączył: 23.03.2011

Ostrzeżenie: (0%)
-----


Witam buduję Stronę na php-fusion , chciałem dodać 2 panele po prawej z stronie z dynamicznymi zakładkami , jak jest tylko jeden panel włączony to wszystko jet ok , problem pojawia się gdy włącze 2 panel , to wtedy już nie działa. Jak klikam w zakładki w drugim panelu , to zawartość ich zmienia się w pierwszym , mimo że nie klikałem w nim. Jak to rowiązać ? Oto kod :
Kod
openside("Klasyfikacje"); ?>

    <script>
    //<![CDATA[
    function pokazdiv(el) {
    for(var i=1; i<=3; i++) {
    if(el == i) {
    document.getElementById(el).style.display = "block";
    }else{
    document.getElementById(i).style.display = "none";
    }
    }
    }
    //]]>
    </script>
    
    
    
    
    <a href="java script:void(0);" onclick="pokazdiv('1');">Galeria</a>
    <a href="java script:void(0);" onclick="pokazdiv('2');">Filmy</a>
    <a href="java script:void(0);" onclick="pokazdiv('3');">Ogolne</a>
    
    <div id="1">jeden</div>
    <div id="2" style="display:none">dwa</div>
    <div id="3" style="display:none">trzy</div>



<?php closeside();
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Diego22
post
Post #2





Grupa: Zarejestrowani
Postów: 64
Pomógł: 0
Dołączył: 23.03.2011

Ostrzeżenie: (0%)
-----


hmm a w tym panelu jak będzie ?
zmieniłem id ale nie działały oba ;/
kod:
  1. openside("Klasyfikacje"); ?>
  2.  
  3. <script>
  4. //<![CDATA[
  5. function pokazdiv(el) {
  6. for(var i=1; i<=3; i++) {
  7. if(el == i) {
  8. document.getElementById(el).style.display = "block";
  9. }else{
  10. document.getElementById(i).style.display = "none";
  11. }
  12. }
  13. }
  14. //]]>
  15. </script>
  16.  
  17. <center>
  18. <b>
  19. <a href="java script:void(0);" onclick="pokazdiv('1');">Kierowców</a> |
  20. <a href="java script:void(0);" onclick="pokazdiv('2');">Konstruktorów</a>
  21. </b>
  22. </center>
  23. <div id="1" style="display: block; ">
  24. <br><b><center>Klasyfikacja Kierowców</center></b><br>
  25. <center><table style=' text-align: left; width: 261px; height: 119px;'
  26. background='http://rfleague.xaa.pl/themes/Liga2011/images/Strona2/tlokla.png'
  27. border='0' cellpadding='0' cellspacing='0'>
  28. <tbody>
  29. <tr>
  30. <td style='vertical-align: top; font-weight: bold;
  31. text-align: center; width: 60px; color: rgb(255, 255,
  32. 255);'>1.<br>
  33. </td>
  34. <td style='vertical-align: top; width: 150px; height:
  35. 25px; color: rgb(255, 255, 255); font-weight: bold;
  36. text-align: center;'>&nbsp;&nbsp; nick &nbsp;&nbsp; <br>
  37. </td>
  38. <td style='vertical-align: top; font-weight: bold;
  39. text-align: left; color: rgb(255, 255, 255);'>0<br>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td style='vertical-align: top; font-weight: bold;
  44. text-align: center; color: rgb(255, 255, 255);'>2.<br>
  45. </td>
  46. <td style=' vertical-align: top; color: rgb(255, 255,
  47. 255); font-weight: bold; text-align: center; width:
  48. 150px;'>nick<br>
  49. </td>
  50. <td style='vertical-align: top; height: 23px; font-weight:
  51. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td style='vertical-align: top; font-weight: bold;
  56. text-align: center; color: rgb(255, 255, 255);'>3.<br>
  57. </td>
  58. <td style='vertical-align: top; color: rgb(255, 255, 255);
  59. font-weight: bold; text-align: center;'>nick<br>
  60. </td>
  61. <td style='vertical-align: top; height: 23px; font-weight:
  62. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td style='vertical-align: top; font-weight: bold;
  67. text-align: center; color: rgb(255, 255, 255);'>4.<br>
  68. </td>
  69. <td style='vertical-align: top; color: rgb(255, 255, 255);
  70. font-weight: bold; text-align: center;'>nick<br>
  71. </td>
  72. <td style='vertical-align: top; height: 23px; font-weight:
  73. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td style=' vertical-align: top; font-weight: bold;
  78. text-align: center; color: rgb(255, 255, 255);'>5.<br>
  79. </td>
  80. <td style='vertical-align: top; color: rgb(255, 255, 255);
  81. font-weight: bold; text-align: center;'>nick<br>
  82. </td>
  83. <td style='vertical-align: top; height: 23px; font-weight:
  84. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  85. </td>
  86. </tr>
  87. </tbody>
  88. </table></center>
  89. <b><center><a href='http://rfleague.xaa.pl/viewpage.php?page_id=1' >pełna</a></center></b>
  90. </div>
  91.  
  92.  
  93. <div id="2" style="display: none; ">
  94. <br><b><center>Klasyfikacja Konstruktorów</center></b><br>
  95. <center><table style=' text-align: left; width: 261px; height: 119px;'
  96. background='http://rfleague.xaa.pl/themes/Liga2011/images/Strona2/tlokla.png'
  97. border='0' cellpadding='0' cellspacing='0'>
  98. <tbody>
  99. <tr>
  100. <td style='vertical-align: top; font-weight: bold;
  101. text-align: center; width: 60px; color: rgb(255, 255,
  102. 255);'>1.<br>
  103. </td>
  104. <td style='vertical-align: top; width: 150px; height:
  105. 25px; color: rgb(255, 255, 255); font-weight: bold;
  106. text-align: center;'>&nbsp;&nbsp; RedBull &nbsp;&nbsp; <br>
  107. </td>
  108. <td style='vertical-align: top; font-weight: bold;
  109. text-align: left; color: rgb(255, 255, 255);'>0<br>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td style='vertical-align: top; font-weight: bold;
  114. text-align: center; color: rgb(255, 255, 255);'>2.<br>
  115. </td>
  116. <td style=' vertical-align: top; color: rgb(255, 255,
  117. 255); font-weight: bold; text-align: center; width:
  118. 150px;'>McLaren<br>
  119. </td>
  120. <td style='vertical-align: top; height: 23px; font-weight:
  121. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td style='vertical-align: top; font-weight: bold;
  126. text-align: center; color: rgb(255, 255, 255);'>3.<br>
  127. </td>
  128. <td style='vertical-align: top; color: rgb(255, 255, 255);
  129. font-weight: bold; text-align: center;'>Mercedes<br>
  130. </td>
  131. <td style='vertical-align: top; height: 23px; font-weight:
  132. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td style='vertical-align: top; font-weight: bold;
  137. text-align: center; color: rgb(255, 255, 255);'>4.<br>
  138. </td>
  139. <td style='vertical-align: top; color: rgb(255, 255, 255);
  140. font-weight: bold; text-align: center;'>Ferrari<br>
  141. </td>
  142. <td style='vertical-align: top; height: 23px; font-weight:
  143. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td style=' vertical-align: top; font-weight: bold;
  148. text-align: center; color: rgb(255, 255, 255);'>5.<br>
  149. </td>
  150. <td style='vertical-align: top; color: rgb(255, 255, 255);
  151. font-weight: bold; text-align: center;'>Sahara<br>
  152. </td>
  153. <td style='vertical-align: top; height: 23px; font-weight:
  154. bold; text-align: left; color: rgb(255, 255, 255);'>0<br>
  155. </td>
  156. </tr>
  157. </tbody>
  158. </table></center>
  159. <b><center><a href='http://rfleague.xaa.pl/viewpage.php?page_id=7' >pełna</a></center></b>
  160.  
  161.  
  162.  
  163. </div>
  164.  
  165. <?php closeside();
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 04:21