admin管理员组文章数量:1415476
I am building an admin dashboard with Bootstrap 3, and require a "View More" button to un-collapse some content. This works fine with the following code, however on page load we see the collapse content momentarily whilst the animation takes place.
A fiddle can be found here: /
And I initialise the collapse with the following code:
<script src="//ajax.googleapis/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".collapse").collapse();
});
</script>
Does anyone know how to remove that flicker of un-hidden content?
Note: This question refers to Bootstrap 2, and the problem was never pletely fixed with a correct solution anyway.
I am building an admin dashboard with Bootstrap 3, and require a "View More" button to un-collapse some content. This works fine with the following code, however on page load we see the collapse content momentarily whilst the animation takes place.
A fiddle can be found here: http://jsfiddle/sSNG4/
And I initialise the collapse with the following code:
<script src="//ajax.googleapis./ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".collapse").collapse();
});
</script>
Does anyone know how to remove that flicker of un-hidden content?
Note: This question refers to Bootstrap 2, and the problem was never pletely fixed with a correct solution anyway.
Share Improve this question edited May 23, 2017 at 12:02 CommunityBot 11 silver badge asked Mar 11, 2014 at 14:01 mpdcmpdc 3,5705 gold badges30 silver badges49 bronze badges1 Answer
Reset to default 6http://getbootstrap./javascript/#collapse-usage
- In your HTML, change
class="collapse in"
toclass="collapse"
. Thein
class indicates that it's "open". - Remove the JavaScript pletely. The
data-
attributes will tell Bootstrap to initialize the collapsible div automatically.
http://jsfiddle/mblase75/YyKhH/
本文标签: javascriptBootstrap 3 collapseflicker of hidden content on page loadStack Overflow
版权声明:本文标题:javascript - Bootstrap 3 collapse - flicker of hidden content on page load - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745168731a2645842.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论