SlideToggle在我的网站无法正常工作。主要问题IT没有滑动,当我点击“显示”按钮时,它只是马上显示内容。但是,通过按下“隐藏”按钮,它完美地向上滑动以隐藏内容。这是我的JavaScript。谁知道这里可能是什么问题?slideToggle无法正常工作
$(document).ready(function(e) {
$('.newsFull').hide();
$('.switch').click(function(e) {
$(this).parent().children('.switch').toggle();
var text = $(this).parent().children('.newsFull');
text.slideToggle();
});
});
这里是一个链接http://jsfiddle.net/ZxF9j/
这似乎CSS/HTML相关的...就像如果jQuery的找不到元素的高度。请发布更多代码。小提琴将不胜感激。 – 2013-02-20 05:19:27
这里是http://jsfiddle.net/ZxF9j/ – 2013-02-20 05:28:00