如何创建 YUI 菜单,您可以单击其中打开子菜单?

发布于 2024-07-08 01:11:38 字数 548 浏览 7 评论 0原文

我们有一个通过 YUI 菜单按钮激活的多层/分层 YUI 菜单。 这个菜单中的所有内容都运行得很好。 如果将鼠标悬停在带有子菜单的菜单项上,子菜单将按预期显示。 您可以从这个子菜单中选择一个项目。

然而,问题是您还可以单击该菜单的父项来关闭整个菜单。 事实上,我想要相反的东西。 我希望单击父菜单项使顶级菜单保持打开状态并打开子菜单(即,我希望单击在功能方面与鼠标悬停事件相同)。

旁注:这在典型的 Web 浏览器(例如 Firefox)上不是问题,其中单击事件并不重要,因为如果没有鼠标悬停就无法单击。 这是 iPhone 上的问题,因为 iPhone 没有鼠标悬停事件。

我一直在使用 autosubmenudisplay 属性和 keepopen 属性,希望我可以处理父项单击事件来执行我想要的操作,但到目前为止,我还没有成功。 如果我将 autosubmenudisplay 设置为 false,我无法弄清楚如何手动显示子菜单。 keepopen 属性似乎不起作用,而是我将其设置在菜单或子菜单上。

有没有办法获得我想要的行为,让我们的 iPhone 用户满意?

We have a multi-tiered/hierarchical YUI menu activated via a YUI menu button. Everything in this menu works pretty well. If you mouseover a menu item with a submenu, the submenu appears as expected. You can select an item from this submenu just fine.

The problem, however, is that you can also click on the parent items of this menu which closes the entire menu. In fact, I want the opposite. I'd like a click of a parent menu item leave the top level menu open and open the submenu (i.e. I want a click to be identical to a mouseover event in terms of functionality).

Side note: This isn't an issue on a typical web browser (e.g. Firefox) where the click event doesn't matter because you can't have a click without a mouseover. This is an issue on the iPhone which doesn't have a mouseover event.

I've been playing with the autosubmenudisplay properties and keepopen properties, hoping I can just handle the parent item click events to do what I want but, so far, I've been unsuccessful. If I set autosubmenudisplay to false, I can't figure out how to get the submenus to display manually. The keepopen property doesn't seem to work rather I set it on the menu or submenus.

Is there a way to get the behavior I want so our iPhone users are happy?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

∞梦里开花 2024-07-15 01:11:38

Todd Kloots,YUI 按钮和菜单小部件的作者。 看了你的要求。 不幸的是,当前版本的 YUI 按钮和菜单不支持您想要创建的交互类型。 请随意通过 SourceForge 提出功能请求,我将尝试在 YUI 的未来版本中解决此问题。

  • 托德

Todd Kloots, author of the YUI Button and Menu widgets here. Took at look at your request. Unfortunately the current version YUI Button and Menu aren't designed to support the type of interaction you are looking to create. Feel free to file a feature request via SourceForge and I'll try to work on this for a future version of YUI.

  • Todd
拥抱没勇气 2024-07-15 01:11:38

这并不完全符合您的要求,但是您看过 iUI 吗? 您也许可以从实现中学到一些技巧。

It's not exactly what you asked for, but have you looked at iUI? You may be able to pick up some tricks from the implementation.

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