由于某些原因,SlideToggle在我的网站上无法正常工作。主要问题是,当我点击“显示”按钮时,它不会向下滑动,而是直接显示内容。但它可以通过按下“隐藏”按钮来完美地滑动隐藏内容。这是我的JavaScript。谁知道这里会有什么问题呢?
$(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/
发布于 2013-02-20 13:35:26
只需添加
.newsFull {display:inline-block;}到你的CSS
Check this fiddle
https://stackoverflow.com/questions/14972769
复制相似问题