【发布时间】:2017-01-22 15:39:06
【问题描述】:
我有一个插件 (https://github.com/olivM/jQuery-Selectbox) 填充选择下拉菜单并设置下拉菜单的样式。
鉴于以下方法我无法进行分离,请通过我的代码中的偶数处理程序将元素修改附加到下拉列表中。
我只能在 firebug 检查器中手动执行此操作。
$('#elem').selectbox('detach');
$('#elem').selectbox('attach');
我需要做什么来分离然后将选择框附加到 html 下拉列表?
Method Description
attach .selectbox("attach") Attach the select box to a jQuery selection. This will hide the element and create its custom replacement.
change .selectbox("change") Change selected attribute of the selectbox.
close .selectbox("close") Close opened selectbox.
detach .selectbox("detach") Remove the selectbox functionality completely. This will return the element back to its pre-init state.
disable .selectbox("disable") Disable the selectbox.
enable .selectbox("enable") Enable the selectbox.
open .selectbox("open") Call up attached selectbox.
option .selectbox("option", options) Get or set any selectbox option. If no value is specified, will act as a getter.
【问题讨论】:
-
插件的原始页面不可用,所以我获取了一个存档 - web.archive.org/web/20160323122843/http://…
-
奇怪的是,我需要使用超时来让我的命令工作。我想这是一个同步问题。