jQuery UI 1.8.17 和 selectmenu
这个问题的答案可能会让我“doh!”时刻,但是我在哪里可以找到一个可与较晚(ish)jquery ui 版本一起使用的有效 selectmenu 插件?
我从所有这些地方尝试过,但似乎都不起作用:
https ://github.com/fnagel/jquery-ui
http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html
如果您认为其中任何一个应该有效,请在正确的方向,这样我就可以调查为什么它对我不起作用。
The answer to this question will probably give me a "doh!" moment, but where can I find a working selectmenu plugin that work with a late(ish) jquery ui version?
Iv tried from all of these places, but none seem to work:
https://github.com/fnagel/jquery-ui
http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html
If you believe any of them should work, please point me in the right direction so that I may be able to investigate why it doesnt work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也有同样的问题。但现在我解决了它:
1)从以下位置获取 JavaScript-Selectmenu 源代码:
http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html
它是 jQuery UI 1.9 的版本。
所以因为 1.8.17 不知道 _super,所以将 _super 更改为旧的:
//this._super( key, value );
$.Widget.prototype._setOption.call(this, key, value);
在“drawmenu”函数中将“select”更改为“selected”
(this.menu.menu({ selected: )
2) 从 1.9m5 开始使用以下函数增强 jquery.ui.widget.js (_delay 从 1.9m6 开始):
_绑定,_延迟。
添加“this.bindings = $();” _createWidget。
添加“this.bindings.unbind(“.”+this.widgetName);”摧毁。
3) 获取此 css 并包含它:
.ui-selectmenu-menu { 填充:0;保证金:0;位置:绝对;顶部:0;显示:无; }
.ui-selectmenu-menu .ui-menu .ui-menu-item a { 填充:0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-state-disabled { 填充:0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-selectmenu-optgroup { 字体粗细:粗体;行高:1.5;内边距:2px 0.4em;保证金:0.5em 0 0 0; }
.ui-selectmenu-open { 显示:块; }
.ui-selectmenu-button span.ui-icon { 右:0.5em;左:自动; }
.ui-selectmenu-button span.ui-button-text { 文本对齐:左; padding: 0.4em 2.1em 0.4em 1em }
4) jQuery UI 1.8.17 有一个菜单小部件。它是自动完成的一部分。从那里提取它并将其放入一个新文件中。
希望这有帮助
沃尔夫冈
I had the same problems. But now I solved it:
1) Take the JavaScript-Selectmenu Source-Code from:
http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html
It is a version from jQuery UI 1.9.
So because 1.8.17 does not know _super, change _super to the old one:
//this._super( key, value );
$.Widget.prototype._setOption.call (this, key, value);
In the function "drawmenu" change "select" to "selected"
(this.menu.menu({ selected: )
2) Enhance jquery.ui.widget.js with the following functions from 1.9m5 (_delay from 1.9m6):
_bind, _delay.
add "this.bindings = $();" to _createWidget.
add "this.bindings.unbind( "." + this.widgetName );" to destroy.
3) Take this css and include it:
.ui-selectmenu-menu { padding: 0; margin: 0; position:absolute; top: 0; display: none; }
.ui-selectmenu-menu .ui-menu .ui-menu-item a { padding: 0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-state-disabled { padding: 0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-selectmenu-optgroup { font-weight: bold; line-height: 1.5; padding: 2px 0.4em; margin: 0.5em 0 0 0; }
.ui-selectmenu-open { display: block; }
.ui-selectmenu-button span.ui-icon { right: 0.5em; left: auto; }
.ui-selectmenu-button span.ui-button-text { text-align: left; padding: 0.4em 2.1em 0.4em 1em }
4) jQuery UI 1.8.17 has a menu-Widget. It's part of the autocomplete. Extract it from there and put it in a new file.
Hope this helps
Wolfgang
感兴趣的人更新:
https://github.com/fnagel/jquery-ui
最近更新该代码适用于 jQuery 1.10.1 和 jQuery UI 1.10.3
update for those interested:
https://github.com/fnagel/jquery-ui
was recently updated and the code works with jQuery 1.10.1 and jQuery UI 1.10.3