Compatibilité entre navigateur
Bonjour,
j'ai créer un petit script me permettant d'enrouler/dérouler une liste <ul><li>, cela fonctionne très bien sous firefox, mais pas du tout sous IE (ni le 6,ni le 7, ni le 8...)
voici mon html :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
<div id="archives">
<a href="#mai" title="#mai" class="mois" name="#mai">mai</a>
<ul>
<li>1er : <a href="spip.php?article94" title="Martyre">Martyre</a></li>
</ul>
<a href="#avril" title="#avril" class="mois" name="#avril">avril</a>
<ul>
<li>29 : <a href="spip.php?article93" title="SCORN">SCORN</a></li>
</ul>
</div> |
il y a plus de <li> dans la vrai page, mais la j'ai simplifié pour ne pas surchargé.
et le javascript :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$(document).ready(function() {
$("#archives ul").not(":first").children("li").hide();
$("#archives ul:first").addClass("actif");
$("#archives a.mois").click(function() {
if ($(this).next("ul").hasClass("actif")) {
$(this).next("ul").children("li").slideUp("slow");
$(this).next("ul").removeClass("actif");
} else {
$("#archives a.mois").next("ul")
.removeClass("actif")
.children("li").slideUp("slow");
$(this).next("ul")
.addClass("actif")
.children("li").slideDown("slow");
}
});
}); |