![]() |
![]() |
![]()
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(); |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 116 Pomógł: 29 Dołączył: 13.12.2010 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
ID każdego DIVa musi być unikatowe dla całego dokumentu HTML.
Najlepiej zrobić: Dla kolejnych paneli zmieniasz tylko drugi parametr funkcji pokazdiv() i pierwszy człon id wszystkich divów w panelu. Ten post edytował morbic 11.05.2012, 21:42:26 -------------------- "Aby zrozumieć rekurencję, musisz najpierw zrozumieć rekurencję."
|
|
|
![]()
Post
#3
|
|
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:
|
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 116 Pomógł: 29 Dołączył: 13.12.2010 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Przeczytaj jeszcze raz kod, który napisałem i porównaj go ze swoim. W kodzie, który wkleiłeś przed chwilą nic nie jest zmienione.
-------------------- "Aby zrozumieć rekurencję, musisz najpierw zrozumieć rekurencję."
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 64 Pomógł: 0 Dołączył: 23.03.2011 Ostrzeżenie: (0%) ![]() ![]() |
To jak w pierwszym panelu mam kod taki jak wyżej post co dodałem a w , drugim dodam taki :
Kod openside("Klasyfikacje"); ?> <script> //<![CDATA[ function pokazdiv(el, panel) { for(var i=1; i<=3; i++) { if(el == i) { document.getElementById(panel+'_'+el).style.display = "block"; }else{ document.getElementById(panel+'_'+i).style.display = "none"; } } return false; } //]]> </script> <a href="#" onclick="return pokazdiv('1', 'panel1');">Galeria</a> <a href="#" onclick="return pokazdiv('2', 'panel1');">Filmy</a> <div id="panel1_1" style="display: block; "> <br><b><center>Klasyfikacja Kierowców</center></b><br> <center><table style=' text-align: left; width: 261px; height: 119px;' background='http://rfleague.xaa.pl/themes/Liga2011/images/Strona2/tlokla.png' border='0' cellpadding='0' cellspacing='0'> <tbody> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; width: 60px; color: rgb(255, 255, 255);'>1.<br> </td> <td style='vertical-align: top; width: 150px; height: 25px; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'> nick <br> </td> <td style='vertical-align: top; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>2.<br> </td> <td style=' vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center; width: 150px;'>nick<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>3.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>nick<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>4.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>nick<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style=' vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>5.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>nick<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> </tbody> </table></center> <b><center><a href='http://rfleague.xaa.pl/viewpage.php?page_id=1' >pełna</a></center></b> </div> <div id="panel1_2" style="display: none; "> <br><b><center>Klasyfikacja Konstruktorów</center></b><br> <center><table style=' text-align: left; width: 261px; height: 119px;' background='http://rfleague.xaa.pl/themes/Liga2011/images/Strona2/tlokla.png' border='0' cellpadding='0' cellspacing='0'> <tbody> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; width: 60px; color: rgb(255, 255, 255);'>1.<br> </td> <td style='vertical-align: top; width: 150px; height: 25px; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'> RedBull <br> </td> <td style='vertical-align: top; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>2.<br> </td> <td style=' vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center; width: 150px;'>McLaren<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>3.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>Mercedes<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style='vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>4.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>Ferrari<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> <tr> <td style=' vertical-align: top; font-weight: bold; text-align: center; color: rgb(255, 255, 255);'>5.<br> </td> <td style='vertical-align: top; color: rgb(255, 255, 255); font-weight: bold; text-align: center;'>Sahara<br> </td> <td style='vertical-align: top; height: 23px; font-weight: bold; text-align: left; color: rgb(255, 255, 255);'>0<br> </td> </tr> </tbody> </table></center> <b><center><a href='http://rfleague.xaa.pl/viewpage.php?page_id=7' >pełna</a></center></b> </div> <?php closeside(); To mi wogule nie działa wtedy pierwszy panel Ten post edytował Diego22 11.05.2012, 22:28:08 |
|
|
![]()
Post
#6
|
|
![]() Grupa: Zarejestrowani Postów: 116 Pomógł: 29 Dołączył: 13.12.2010 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Bo funkcja pokazdiv() nie może być zdefiniowana dwa razy.
-------------------- "Aby zrozumieć rekurencję, musisz najpierw zrozumieć rekurencję."
|
|
|
![]()
Post
#7
|
|
Grupa: Zarejestrowani Postów: 64 Pomógł: 0 Dołączył: 23.03.2011 Ostrzeżenie: (0%) ![]() ![]() |
to teraz co mam z tym zrobić ?
pomoże ktoś ? |
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 39 Pomógł: 8 Dołączył: 11.05.2012 Ostrzeżenie: (0%) ![]() ![]() |
Hmm, tylko, że błędu nie masz w tym kodzie. Wrzuć sobie go jako czystą stronę.
Obstawiam, że Firebug nie zwróci nic niepożądanego. Co do elementu z którym się gryzie - zgubiłem szklaną kulę, bez wpisu z firebuga / linku do strony nie jestem w stanie nic zlokalizować. |
|
|
![]()
Post
#9
|
|
Grupa: Zarejestrowani Postów: 64 Pomógł: 0 Dołączył: 23.03.2011 Ostrzeżenie: (0%) ![]() ![]() |
1 panel działa jak dam 2 to już nic ;/
mam podać link do www? |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 31.07.2025 - 10:53 |