2016-09-20 2 views
3

Eine kleine Frage über die Browser-Kompatibilität.jquery Tabelle Kollaps funktioniert nicht auf ie11.035 und Firefox 46.0.1

Ich habe diesen Code zu erweitern und eine tbody einer HTML-Tabelle zu reduzieren:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js"></script> 
    <style type="text/css"> 

    </style> 
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script> 
    <script type='text/javascript'>//<![CDATA[ 
$(document).ready(function() { 
     $(".expand").click(function() { 
      $("#mytable tbody").show("slow"); 
     }); 
     $(".collapse").click(function() { 
      $("#mytable tbody").hide("fast"); 
     }); 
    }); 

</script> 
<center> 

<table border="1" width="1200px" id="mytable"> 
<thead> 
<tr> 
<td style="border:red 0px solid"></td> 
<td><b>Numero</b></td> 
<td><b>Data apertura</b></td> 
<td><b>Data scadenza</b></td> 
<td><b>Data chiusura</b></td> 
<td><b>Competenza</b></td> 
<td><b>Priorità </b></td> 
<td><b>File caricati</b></td> 
<td><b>Assegnata a</b></td> 
<td><b>Tipo ricontatto</b></td> 
<td><b>Stadio</b></td> 
<td><b>Stato</b></td> 
<td style="width:80px"><a class="expand" href="#"><button type="button" style="width:100%" >Espandi</a></button></td> 
</tr> 

<tr class="clickable"> 
<td>Pallino</td> 
<td>1-2016</td> 
<td>10/09/2016</td> 
<td>25/10/2016</td> 
<td></td> 
<td>caf</td> 
<td>alta</td> 
<td></td> 
<td>delegato</td> 
<td>78576</td> 
<td>presa in carico</td> 
<td>aperta</td> 
<td style="width:80px"><a class="collapse" href="#"><button type="button" style="width:100%">Riduci</a></button></td> 
</tr> 
</thead> 

<tbody style="display:none;"> 
<tr> 
<td colspan="2"><b>Descrizione</b></td> 
<td colspan="11">testo Descrizione</td> 
</tr> 

<tr> 
<td colspan="2"><b>Note</b></td> 
<td colspan="11">testo Note</td> 
</tr> 

<tr> 
<td colspan="2"><b>Note delegato</b></td> 
<td colspan="11">Note delegato</td> 
</tr> 

<tr> 
<td colspan="13"><center> 
<input name="Modifica" type="submit" value="Modifica"/> &nbsp; 
<input type="reset" value="Cancella"> &nbsp; 
<input type="button" value="Annulla" onclick="window.location='privata.php';"></center> 
</td> 
</tr> 
</tbody> 
</table> 

Es auf Chrome funktioniert und Rand, aber mit IE und Firefox es nicht, und ich weiß nicht, warum. Ich nehme den Code in http://jsfiddle.net/Trufa/b3pTg/1/, und die Seite funktioniert in allen genannten Browsern.

Kann mir jemand sagen, warum es nicht auf meiner läuft, und wie kann ich es lösen?

+0

manchmal besteht die Antwort in den kleinen Dingen: ich schreibe statt ... und i gehalten jQuery-Code, um zu sehen, ob es ein Fehler darin zu lesen! sorry, tut mir leid, sorry ... – Chuby

+0

@brian tompsett danke! :) – Chuby

Antwort

2

Hallo Ihr HTML-Code hat einige Fehler: Bitte nehmen Sie sich einen Blick auf diese:

<td style="width:80px"><a class="expand" href="#"><button type="button" style="width:100%" >Espandi</a></button></td> 

Es sollte ersetzt werden:

<td style="width:80px"><a class="expand" href="#"><button type="button" style="width:100%" >Espandi</button></a></td> 

Es funktioniert nach dem Ändern des Codes.

Mit freundlichen Grüßen

+0

Danke @Hamir :) – Chuby

+0

Kein Problem. wann immer du willst, ping mich. ;) –

Verwandte Themen