问题描述
我在 jQuery
中的 slideToggle
函数有问题。它根本不光滑。每当我点击查看更多按钮,应该 slideToggle
的内容只是弹出,没有什么效果。
I have a problem with the slideToggle
function in jQuery
. It is not smooth at all. Whenever I click the "See More" button, the content that should slideToggle
, just pops out with no effect what-so-ever.
这是HTML代码:
<td class="third">
<a href="javascript:void(0)" class="btn btn-primary upgrade1">See More</a>
</td>
<tr class="see_more" id="see_more">
<td colspan="3" class="see_more_content">Hello! How are you doing</td>
</tr>
这是CSS:
.third{
text-align:right;
padding-right:10px;
}
.see_more{
display:none;
}
.see_more_content{
text-align:center;
}
最后,javascript:
And finally, the javascript:
<script type="text/javascript">
$(document).ready(function(){
$(".upgrade1").click(function() {
$("#see_more").slideToggle("slow");
});
});
</script>
我已阅读文章动画跳 - 快速提示,但我不认为问题。因为我没有指定任何 margin
或 padding
到 slideToggle
。
I have read article "Animation Jump - quick tip", but I don't think that is the problem here. Since I haven't specified any margin
or padding
to the content that should slideToggle
.
感谢您的帮助。
推荐答案
表格列似乎没有滑动。您应该尝试使用DIV来找到解决方法。他们滑动和动画更好。你还可以将内容封装到一个div,幻灯片?也许会推动表格行模仿幻灯片。
Table Rows don't seem to slide. You should try to find a workaround by using DIV instead. They slide and animate much better. You could also wrap the content into a div, and slide that? Maybe that would push the table row to imitate a slide.
这篇关于jquery - slideToggle不顺利的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!