鼠标悬停时的 dijit 菜单

发布于 2024-12-24 23:28:16 字数 195 浏览 3 评论 0原文

我正在使用 dijit.menu 的菜单,它可以通过右键单击和左键单击来工作。 如何在鼠标悬停时打开菜单并在鼠标移出时关闭菜单?

dijitActionMenu = new dijit.Menu({
   targetNodeIds:[actionMenuId],
   leftClickToOpen:"true"
});

I am using menu using dijit.menu and Its work with right click and left click.
How I open the menu on mouse over and close on onmouseout?

dijitActionMenu = new dijit.Menu({
   targetNodeIds:[actionMenuId],
   leftClickToOpen:"true"
});

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

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

发布评论

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

评论(2

幽蝶幻影 2024-12-31 23:28:16

您是否尝试过类似的内容

// Create a new Tooltip
var tip = new dijit.Tooltip({
    // Label - the HTML or text to be placed within the Tooltip
    label: '<div class="myTipType">This is the content of my Tooltip!</div>',
    // Delay before showing the Tooltip (in milliseconds)
    showDelay: 250,
    // The nodes to attach the Tooltip to
    // Can be an array of strings or domNodes
    connectId: ["myElement1","myElement2"]
});

更多详细信息请参见dialogs_tooltips。甚至dijit.Menu也有onMouseOver 。

onMouseOver 事件

Have you tried something like

// Create a new Tooltip
var tip = new dijit.Tooltip({
    // Label - the HTML or text to be placed within the Tooltip
    label: '<div class="myTipType">This is the content of my Tooltip!</div>',
    // Delay before showing the Tooltip (in milliseconds)
    showDelay: 250,
    // The nodes to attach the Tooltip to
    // Can be an array of strings or domNodes
    connectId: ["myElement1","myElement2"]
});

More details are here dialogs_tooltips.Even dijit.Menu have onMouseOver even.

onMouseOver Event

掩耳倾听 2024-12-31 23:28:16

我能够获得 dijit/Menu onmouseover

创建一个将调用 onmouseover 事件的元素。

<a href="#" onmouseover="show();"  onmouseout="hideMenu();">Element</a>

show() 将调用自定义小部件,该小部件将为您创建菜单。

例如,

show = function() {
    var roll = new rollover()
}

rollover.js 将是自定义小部件。

从它的构造函数中,您可以调用该函数并创建菜单。

pMenu = new Menu({ class: "rollovermenu", id: "rolloverid" });

I am able to get the dijit/Menu onmouseover.

Create an element which will invoke onmouseover event.

<a href="#" onmouseover="show();"  onmouseout="hideMenu();">Element</a>

show() will call custom widget which will create menu for you.

E.g.,

show = function() {
    var roll = new rollover()
}

And rollover.js will be the custom widget.

From the constructor of it, you can invoke the function and create the menu.

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