我让我的 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");
});
});