1

我让我的 jquery slideToggle 为 Firefox 工作。好吧,它并不完美,因为当它下滑时,性能会有些跳跃。我尝试了不同的解决方法,但没有人能正确地解决这个问题。

所以第一个问题是,什么会导致我的代码出现这种小跳动。

然后更大的问题是在 IE 中的显示。IE6 和 IE7。隐藏的 div 在初始姿势中不隐藏在 IE 中。而且滑动的动作也很奇怪。

我希望有人能把我救出这个sh......

只需使用 Firefox 访问我的网站:

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

并检查它,然后将其与 IE6&7 进行比较。

源代码可通过 firefox 或 firebug 访问。

我希望任何人都可以提供帮助。

这是我的jQuery代码:

$(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] = theHeight;
});

// 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");
});

});

4

1 回答 1

0

只需要强制元素的宽度!

<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>

于 2011-06-14T15:13:49.677 回答