简体   繁体   English

如何在React-Bootstrap中实现下拉动画?

[英]How to implement dropdown animation in React-Bootstrap?

The native dropdown from React-Bootstrap is very choppy. 来自React-Bootstrap的本地下拉列表非常不稳定。 I would like to smooth it out. 我想解决一下。 I found this class for plain Bootstrap and am wondering how I would port it over to React, or just accomplish something similar: 我为普通的Bootstrap找到了这个类,并且想知道如何将其移植到React上,或者只是完成类似的事情:

https://startbootstrap.com/snippets/animated-navbar-dropdown/ https://startbootstrap.com/snippets/animated-navbar-dropdown/

Thanks! 谢谢!

I used MadisonTrash's answer here: https://stackoverflow.com/a/32233048/4700234 我在这里使用了MadisonTrash的答案: https ://stackoverflow.com/a/32233048/4700234

I also added the <NativeListener> component from react-native-listener 's in order to prevent clicking the dropdown's header from toggling the dropdown: 我还添加了react-native-listener<NativeListener>组件,以防止单击下拉列表的标题切换下拉列表:

<NativeListener stopClick>
    <NavDropdown>
        ...
    </NavDropdown>
</NativeListener>

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

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