简体   繁体   中英

Jquery UI Autocomplete widget conflicts with jquery.menu widget

My app already has a completed menu using jquery.menu.js found at http://wiki.jqueryui.com/Menu .

I'm now also trying to add the jquery autocomplete widget from jquery ui 1.8.1 - but both of these have a .menu() function that conflicts with each other.

If I put jquery-ui-1.8.1.custom.js first in the head, then autocomplete works but the menu does not. If I put jquery-menu.js first in the head, then the menu works but autocomplete doesnt.

Is there a way to solve this without editing either plugin? (If I edit, I will probably lose those changes the next time either plugin is upgraded)

Since they both extend the jQuery object with a function named menu , there's no other way than to edit one of them to rename it. Reading through the commments, it appears that the code in autocomplete is the genesis of the future menu widget in jQuery UI. I'd suggest that you modify the menu widget code to rename the function, with the thought that you'd simply throw it away when 1.9 is released (as seems to be the plan) with an official menu widget.

无需编辑-您可以在2 之间添加代码以将“菜单”重新映射到其他内容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM