开发者

jQuery replacement of YUI menu -> menu fail

I've got a div containing, among other things, a simple YUI menu -- it's a popup, attached to a widget inside the div. One of the actions in the menu calls a javascript function that does an ajax call to the server, gets new content for the DIV, and replaces the DIV's old content with the new. This includes the menu. This replacement is basically working fine, except that the menu is broken after the replacement: it still appears when the widget is clicked, and the menu items can still be selected (and their actions take place correctly), but the highlighting of the menu items no longer happens and a click outside the menu or a press of the escape key no longer clears the menu -- it just lies there on the screen like a dead fish. I have to refresh the page to make it go away, after which (of course) everything is fine.

Any ideas what the problem is? The code that comes back from the server contains the YUI javascript that creates the menu and sets up a listener connecting the widget and the menu, and a few calls to console.log confirm that the code is there and gets run as part of the ajax replacement. This is driving me kinda crazy... Thanks! 开发者_JAVA技巧

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜