我有一个select div,我正在使用chosen jquery plugin来设置样式和添加功能(最显著的是搜索).这个部门看起来像这样,
<select data-placeholder="add a foobar" id="foobar" style="width: 350px;">
<option value=""></option>
</select>
And I'm using the chosen plugin like this,
$('#foobar').chosen();
While some AJAX is loading, I'd like to disable the entire <select>
div. Maybe with something like this,
$('#foobar').disable()
还是这个
$('#foobar').prop('disabled', true)
我想你明白了.
Any ideas on how to do this? I've tried a number of different things, like using jquery idioms for disabling things, disabling the <select>
which just disables the underlying select, not the chosen stuff on top of it. I've even resorted to manually adding another div with a high z-index
to just grey out the box, but I think that this is likely to be ugly and buggy.
Thanks for the help!