Bootstrap-select插件:如何避免闪烁 [英] Bootstrap-select plugin: how to avoid flickering
问题描述
Bootsrap-select插件非常棒( http://silviomoreto.github.io/bootstrap-select / )。它提供了一种在Bootstrap中创建华丽选择菜单的简便方法。然而,我遇到的一个问题是页面加载时闪烁。我的意思是相当直接的:
The Bootsrap-select plugin is amazing (http://silviomoreto.github.io/bootstrap-select/). It provides an extremely easy way of creating gorgeous select menus in Bootstrap. The one problem I've encountered with it, however, is "flickering" on page load. What I mean by this is fairly straight forward:
- 页面加载原始HTML选择元素(当然看起来像废话)
- Bootstrap-select插件JS运行
- 在页面加载后的某个明显时间,原始HTML select元素被转换为一个不错的Bootstrap-select元素步骤(2)中的JS。
因此,用户首先看到HTML select元素,然后看到它切换到漂亮的Bootstrap-选择项目,因此闪烁。
So, the user first sees the HTML select element and then sees it switch to the pretty Bootstrap-select item, thus the "flickering".
有没有人找到解决问题的好方法?
Has anyone found a good solution to the problem?
推荐答案
要在加载bootstrap-select之前显示空白,请将其添加到您的css。
To show a blank until bootstrap-select is loaded, add this to your css.
select {
visibility: hidden;
}
这篇关于Bootstrap-select插件:如何避免闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!