开发者

Jquery slideToggle IE problem

i got my jquery slideToggle working for Firefox. Ok it's not perfect, because when it slides down the performance is somehow jumpy. I tried different workarounds, but noone helped that right.

So first question is, what could cause this little jumpiness in my code.

And then the bigger problem is the display in IE. IE6 and IE7. The hidden divs are not hidden in IE in the initial pose. And the sliding acts strange, too.

I hope that someone can rescue me out of this sh......

Just visit my site with firefox:

http://www.haus-plan.de/_01_Hausplan/

and check it and then compare it with IE6&7.

The source code is accessible with firefox or firebug.

I hope that anyone can help.

here my jquery code:

$(document).ready(function(){

//  Get height of all des before hide() occurs.  Store height in heightArray, indexed based on the de's position.
heightArray = new Array();
$("div.d_show_hide #de").each(function(i) {
  theHeight = $(this).height();
  heightArray[i] = theHei开发者_JAVA技巧ght;
});

// Hide all des
$("div.d_show_hide #de").hide();

//  When a tt is clicked, 
$("div.d_show_hide .tt").click(function () {
  //  Based on the tt's position in the div, retrieve a height from heightArray, and re-assign that height to the sibling de.
  $(this).next("#de").css({height: heightArray[$("div.d_show_hide .tt").index(this)]});
  //  Toggle the divideVisibility of the de directly after the clicked de
  $(this).next("#de").slideToggle("slow");
});

});


just have to force the width of the elemet!

<li><a href="#" id="sombra" onclick="$('#opt_1').slideToggle(360);">MUEBLES</a>
              <!-- just have to force the width of the elemet! -->
              <ul id="opt_1" style="display:none; width:164px;">

              <li id="imagen_superior"></li>
              <li><a href="salones-en-madrid-capital.php">SALONES</a></li>
              <li><a href="dormitorios-de-matrimonio-en-madrid-capital.php">DORMITORIOS</a></li>
              <li><a href="dormitorios-juveniles-en-madrid-capital.php">JUVENILES</a></li>
              <li><a href="muebles-de-cocina-en-madrid-capital.php">COCINAS</a></li>
              <li><a href="cuartos-de-bano-en-madrid-capital.php">BAÑOS</a></li>
              <li><a href="muebles-auxiliares-en-madrid-capital.php">AUXILIARES</a></li>
              <li><a href="sofas-en-madrid-capital.php">SOFÁS</a></li>
              <li><a href="mesas-en-madrid-capital.php">MESAS</a></li>
              <li><a href="sillas-en-madrid-capital.php">SILLAS</a></li>
              <li><a href="colchoneria-en-madrid-capital.php">COLCHONES</a></li>
              <li id="imagen_inferior"></li>
            </ul>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜