【发布时间】:2015-04-01 02:36:05
【问题描述】:
我的段落一开始需要隐藏,当页面加载时我不知道如何隐藏它。
我正在使用切换 jquery 来展开/隐藏我的段落。我怎样才能做到这一点?
$(document).ready(function () {
$("#toggle").click(function () {
$("#expand").toggle("slow");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<p id="expand">Small or large business look no further for an office cleaning company in Raleigh. Feel confident that commercial cleaning services will get the job done right. Call or contact us today for a quote.</p>
<button id="toggle">Hide/Expand</button>
【问题讨论】:
-
你试过引导程序吗?请参见此处的示例。这可能会帮助你。 getbootstrap.com/javascript/#collapse-example-accordion
-
我没有,但感谢您的想法!