jQuery UI 1.8.17 和 selectmenu

发布于 2024-12-28 00:19:23 字数 803 浏览 3 评论 0原文

这个问题的答案可能会让我“doh!”时刻,但是我在哪里可以找到一个可与较晚(ish)jquery ui 版本一起使用的有效 selectmenu 插件?

我从所有这些地方尝试过,但似乎都不起作用:

http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/

https ://github.com/fnagel/jquery-ui

http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html

http://jqueryui.com/download

如果您认为其中任何一个应该有效,请在正确的方向,这样我就可以调查为什么它对我不起作用。

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:

http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/

https://github.com/fnagel/jquery-ui

http://view.jqueryui.com/selectmenu/demos/selectmenu/default.html

http://jqueryui.com/download

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦断已成空 2025-01-04 00:19:23

我也有同样的问题。但现在我解决了它:

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

晨敛清荷 2025-01-04 00:19:23

感兴趣的人更新:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文