问题
I am using bootstrap select plugin of silviomoreto. I am using it in an ASP.Net MVC application. I am using this with show tick option. The code is like this.
setTimeout(function () {
$('#ddlSortBy').selectpicker({
'selectedText': 'Select'
}
});
}, 200);
The problem is that this plug is not working without settimeout method in my application. I have to attach this plugin within settimeout method and within document.ready method.
However some time when a page loading takes more that 200 ms what I find that plugin is applied to html select but clicking on item in select is not working. So I have to increase the timeout of to attach then its works. But ideally it should works once attached to a html select element.
来源:https://stackoverflow.com/questions/27580074/bootstrap-select-plugin-not-working-with-time-consuming-page-load