Mam kod do panelu, który ma różne podstrony div. Dodaje go i działa, ale jak utworzę drugi, taki sam, dzieją się różne rzeczy: nie działa, zmieniają się w innym panelu. Oto kod: <a href="javascript:void(1);" onclick="pokazdiv('17');">Tabela</a>
<a href="javascript:void(1);" onclick="pokazdiv('18');" >Strzelcy</a>
<a href="javascript:void(1);" onclick="pokazdiv('19');">Kontuzje</a>
<a href="javascript:void(1);" onclick="pokazdiv('20');">Kontuzje2</a>
</center>
<div style="display: none;" id="11">1</div>
<div style="display: none;" id="18">2</div>
<div style="display: none;" id="19">3</div>
<div style="display: none;" id="20">4</div>
<script>
function pokazdiv(el) {
for(var i=16; i<=100; i++) {
if(el == i) {
document.getElementById(el).style.display = "block";
}else{
document.getElementById(i).style.display = "none";
}
}
}
</script>
Mój panel, który chcę zdublować
?>
<div style="display: block;" id="11"><span style="color: #000000;"><center><table cellspacing="0" cellpadding="0" width="220px" height="36px" border="0" ><tbody><tr><td style="background-image: url(http://napoli24h.pl/images/qvoluvur.png);"><center><strong> <a href="javascript:void(0);" onclick="pokazdiv('11');">Tabela</a>
<a href="javascript:void(0);" onclick="pokazdiv('12');" >Strzelcy</a>
<a href="javascript:void(0);" onclick="pokazdiv('13');">Kontuzje</a> </strong>
</center></td></tr></tbody></table><table align="center" width="216" height="236px" style="background-color: #f3f3f3; border: 1px solid #2d98d1;"><span style="color: #000000;"><tbody ><tr><td><center><table style="width: 212px; height: 226px;" border="0" cellspacing="0" cellpadding="1">
<tbody>
<tr>
<td><strong>Poz</strong></td>
<td><strong> </strong></td>
<td><strong>Klub</strong></td>
<td><strong>M</strong></td>
<td><strong>PKT</strong></td>
</tr>
<tr style="background-color: #cce6f3;">
<td>1.</td>
<td><img src="http://www.satfootball.it/images/loghi%20squadre%20serie%20a/juventus%20logo.png" alt="" width="20" height="20" /></td>
<td>Juventus</td>
<td>16</td>
<td>43</td>
</tr>
<tr>
<td>2.</td>
<td style="width: 20px;"><img src="http://icons.iconseeker.com/png/128/italian-football-club/as-roma.png" alt="" width="20" height="20" /></td>
<td>Roma</td>
<td>15</td>
<td>37</td>
</tr>
<tr style="background-color: #2d98d1;">
<td>3.</td>
<td><img src="/images/favicon.png" alt="" width="20" height="20" /></td>
<td>Napoli</td>
<td>16</td>
<td>35</td>
</tr>
<tr height="20">
<td>5.</td>
<td><img src="http://www.acmilan24.com/tpl/img/teamlogos/Fiorentina.png" alt="" width="20" height="20" /></td>
<td>Fiorentina</td>
<td>16</td>
<td>30</td>
</tr>
<tr style="background-color: #cce6f3;" >
<td>4.</td>
<td style="width: 20px;"><img src="http://www.goal-247.com/pictures/logo/40x40logo-Inter%20Milan.png" alt="" width="20" height="20" /></td>
<td>Inter</td>
<td>16</td>
<td>28</td>
</tr>
<tr style="border-bottom: 1px solid #cce6f3;">
<td style="border-bottom-width: 1px; border-bottom-style: solid;">6.<br /></td>
<td style="border-bottom-width: 1px; border-bottom-style: solid;"><img src="http://www.acmilan24.com/tpl/img/teamlogos/Hellas%20Verona.png" alt="" width="20" height="20" /></td>
<td style="border-bottom-width: 1px; border-bottom-style: solid;">Hellas</td>
<td style="border-bottom-width: 1px; border-bottom-style: solid;">16</td>
<td style="border-bottom-width: 1px; border-bottom-style: solid;">26</td>
</tr>
<tr style="background-color: #cce6f3;">
<td>19.</td>
<td><img src="http://www.acmilan24.com/tpl/img/teamlogos/Bologna.png" alt='' height=20>
<td>Bologna</td>
<td>16</td>
<td>12</td>
</tr>
<tr>
<td>20.</td>
<td><img src="http://i.eurosport.com/_iss_/sport/football/club/logo/medium/103511.png" alt="" width="20" height="20" /></td>
<td>Catania</td>
<td>16</td>
<td>10</td>
</tr>
<tr>
<td style="text-align: right;" colspan="6"><strong><a href="/viewpage.php?page_id=4">Cała Tabela</a></strong></td>
</tr>
</tbody>
</table></center></td></tr></tbody></table></div>
<div id="12" style="display: none;"><span style="color: #000000;"><center><table cellspacing="0" cellpadding="0" width="220px" height="36px" border="0" ><tbody><tr><td style="background-image: url(http://napoli24h.pl/images/qvoluvur2.png);"><center><strong> <a href="javascript:void(0);" onclick="pokazdiv('11');">Tabela</a>
<a href="javascript:void(0);" onclick="pokazdiv('12');" >Strzelcy</a>
<a href="javascript:void(0);" onclick="pokazdiv('13');">Kontuzje</a> </strong>
</center></td></tr></tbody></table>
<table align="center" width="216" height="236px" style="background-color: #f3f3f3; border: 1px solid #2d98d1;"><tbody><tr><td><center><table style='text-align: center' border='0' align='center'>
<center>
<table style="text-align: center;" border="0" align="center">
</table>
<table style="width: 212px; height: 226px;" border="0" cellspacing="0" cellpadding="1">
<tbody>
<tr>
<td><strong> </strong></td>
<td><strong>Gracz</strong></td>
<td> </td>
<td><strong>Mecze</strong></td>
<td style="width: 20px;"><strong>Gole</strong></td>
</tr>
<tr style="background-color: #cce6f3;">
<td style="width: 20px;"><img src="/images/1900739.jpg" alt="1900739.jpg" width="20" /></td>
<td>Higuain</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/ARG.png" alt="" width="20" height="20" /></td>
<td style="text-align: center;">21</td>
<td style="text-align: center;">13</td>
</tr>
<tr>
<td><img src="/images/1905868.jpg" alt="1905868.jpg" width="20" /></td>
<td>Callejon</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/ESP.png" alt="http://www.toolani.fr/application/images/icons/flags48/FRA.png" width="20" height="20" /></td>
<td style="text-align: center;">23</td>
<td style="text-align: center;">10</td>
</tr>
<tr style="background-color: #cce6f3;">
<td><img src="/images/73965.jpg" alt="73965.jpg" width="20" /></td>
<td>Hamsik</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/SVK.png" alt="" width="20" height="20" /></td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">6</td>
</tr>
<tr>
<td><img src="/images/52148.jpg" alt="52148.jpg" width="20" /></td>
<td>Pandev</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/MKD.png" alt="http://www.toolani.fr/application/images/icons/flags48/BRA.png" width="20" height="20" /></td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">6</td>
</tr>
<tr style="background-color: #cce6f3;">
<td><img src="http://napoli24h.pl/images/94099.jpg" alt="250019924.jpg" width="20" /></td>
<td>Dzemaili</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/CHE.png" alt="http://www.toolani.fr/application/images/icons/flags32/BEL.png" width="20" height="20" /></td>
<td style="text-align: center;">15</td>
<td style="text-align: center;">3</td>
</tr>
<tr>
<td><img src="/images/250026037.jpg" alt="250026037.jpg" width="20" /></td>
<td>Insigne</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/ITA.png" alt="" width="19" height="19" /></td>
<td style="text-align: center;">23</td>
<td style="text-align: center;">2</td>
</tr>
<tr style="background-color: #cce6f3;">
<td><img src="/images/101473.jpg" alt="101473.jpg" width="20" /></td>
<td>Inler</td>
<td><img src="http://www.toolani.fr/application/images/icons/flags48/CHE.png" alt="" width="20" height="20" /></td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">2</td>
</tr>
<tr>
<td><img src="http://napoli24h.pl/images/250019924.jpg" alt="250064087.jpg" width="20" /></td>
<td>Mertens</td>
<td style="width: 20px;"><img src="http://www.toolani.fr/application/images/icons/flags48/BEL.png" alt="" width="20" height="20" /></td>
<td style="width: 20px; text-align: center;">20</td>
<td style="text-align: center;">2</td>
</tr>
<tr>
<td style="text-align: right;" colspan="8"><strong><a href="/viewpage.php?page_id=1">Kadra Napoli</a></strong></td>
</tr>
</tbody>
</table></center></td></tr></tbody></table></div>
<div id="13" style="display: none;"><span style="color: #000000;"><center><table cellspacing="0" cellpadding="0" width="220px" height="36px" border="0" ><tbody><tr><td style="background-image: url(http://napoli24h.pl/images/qvoluvur3.png);"><center><strong> <a href="javascript:void(0);" onclick="pokazdiv('11');">Tabela</a>
<a href="javascript:void(0);" onclick="pokazdiv('12');" >Strzelcy</a>
<a href="javascript:void(0);" onclick="pokazdiv('13');">Kontuzje</a> </strong>
</center></td></tr></tbody></table>
<table align="center" width="216" height="236px" style="background-color: #f3f3f3; border: 1px solid #2d98d1;"><tbody><tr><td><center><table style='text-align: center' border='0' align='center'>
<center><table style="text-align: center;" border="0" align="center">
</table>
<table style="width: 212px; height: 210px;" border="0">
<tbody>
<tr style="height: 20px;">
<td rowspan="2" height="60">
<table style="width: 60px;" border="0" width="70" height="70">
<tbody>
<tr>
<td style="border: 1px solid #2355b0;" height="60"><img style="margin: 5px;" src="http://napoli24h.pl/images/54106.jpg" alt="Uraz" width="50" height="50" /></td>
</tr>
</tbody>
</table>
</td>
<td>
<strong>G. Mesto</strong>
</td>
<td style="width: 20px; height: 20px;"><span style="color: #000000;"><img style="float: right;" src="http://www.toolani.fr/application/images/icons/flags48/ITA.png" alt="" width="20" height="20" /></span></td>
</tr>
<tr>
<td style="height: 30px;" colspan="2">Uraz: Uszkodzone kolano<br /> Powrót: maj</td>
</tr>
<tr style="height: 20px;">
<td rowspan="2" height="60">
<table style="width: 60px;" border="0" width="70" height="70">
<tbody>
<tr>
<td style="border: 1px solid #2355b0;" height="60"><img style="margin: 5px;" src="http://napoli24h.pl/images/73965.jpg" alt="Uraz" width="50" height="50" /></td>
</tr>
</tbody>
</table>
</td>
<td>
<strong>Marek Hamsik</strong>
</td>
<td style="width: 20px; height: 20px;"><span style="color: #000000;"><img style="float: right;" src="http://www.toolani.fr/application/images/icons/flags48/SVK.png" alt="" width="20" height="20" /></span></td>
</tr>
<tr>
<td style="height: 30px;" colspan="2">Uraz: Uraz stopy<br /> Powrót: Sampdoria?</td>
</tr>
<tr style="height: 20px;">
<td rowspan="2" height="60">
<table style="width: 60px;" border="0" width="70" height="70">
<tbody>
<tr>
<td style="border: 1px solid #2355b0;" height="60"><img style="margin: 5px;" src="http://www.veryicon.com/icon/png/System/Crystal%20Clear%20Actions/Add%20User.png" alt="Uraz" width="50" height="50" /></td>
</tr>
</tbody>
</table>
</td>
<td>
<strong>Zawodnik</strong>
</td>
<td style="width: 20px; height: 20px;"><span style="color: #000000;"><img style="float: right;" src="http://www.toolani.fr/application/images/icons/flags48/ITA.png" alt="" width="20" height="20" /></span></td>
</tr>
<tr>
<td style="height: 30px;" colspan="2">Uraz: ?<br /> Powrót: data</td>
</tr>
</tbody>
</table>
</center></td></tr></tbody></table>
</div>
<script>
function pokazdiv(el) {
for(var i=11; i<=16; i++) {
if(el == i) {
document.getElementById(el).style.display = "block";
}else{
document.getElementById(i).style.display = "none";
}
}
}
</script>
<br>
Proszę o pomoc. Próbowałem wielu rzeczy, ale się nie da
Edytowane przez gandak dnia 30.12.2013 16:57:03
|