简体   繁体   English

Dropdown Bootstrap显示和隐藏事件不等待CSS过渡

[英]Dropdown Bootstrap shown and hidden event not wait for CSS Transition

Dropdown javascript in Bootstrap 3 have 2 event are shown.bs.dropdown and hidden.bs.dropdown and their description: Bootstrap 3中的Dropdown JavaScript有2个事件显示shown.bs.dropdownhidden.bs.dropdown及其描述:

shown.bs.dropdown : This event is fired when the dropdown has been made visible to the user (will wait for CSS transitions, to complete). shown.bs.dropdown :当下拉菜单对用户可见时将触发此事件(将等待CSS转换完成)​​。

hidden.bs.dropdown : This event is fired when the dropdown has finished being hidden from the user (will wait for CSS transitions, to complete). hidden.bs.dropdown :当向用户隐藏下拉列表时将触发此事件(将等待CSS转换完成)​​。

And this is my demo: DEMO 这是我的演示: DEMO

But shown event alway trigger after show event and not wait for CSS transition or wait for the dropdown has been made visible to the user. 但是show事件总是在show事件之后触发,并且不等待CSS过渡或等待下拉菜单对用户可见。 Hidden event too. 隐藏事件。 What's happen? 发生了什么? Does it is bug? 是虫子吗? Or I went wrong something? 还是我出了点问题?

Maybe the porblem occurs because of the loading position of bootstrap.js. 可能是由于bootstrap.js的加载位置而导致出现问题。 You could try if it solves your problem if you load the bootstrap.js at the end of the body-section. 如果在主体部分的末尾加载bootstrap.js,则可以尝试解决问题。 See also the loading of jQuery and Bootstrap 另请参阅jQuery和Bootstrap加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM