jquery菜单盘旋 [英] jquery menu hovering

查看:84
本文介绍了jquery菜单盘旋的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个菜单,当我把鼠标放在一个div上时,它会显示出来,在鼠标上它会淡出。问题是,如果您翻转菜单的任何子菜单,菜单将消失(因为从技术上讲,如果您对其中一个孩子,那么您没有超过父母)有没有办法让孩子滚动算作鼠标?这里是我的代码: http://jsfiddle.net/32bLg/


<解决方案这是一个非常简单的问题,大多数人倾向于使用定时器和特殊情况检查大量过度复杂化。简单的解决方案是通过标记。将悬停目标和菜单放置在同一父级下,并跟踪父级上的悬停。 像这样
您可能还想使用 hoverIntent jQuery插件来避免虚假悬停事件。



UX注释:持续超过500毫秒的淡入淡出动画只是粗鲁。请不要这样做。


i have a menu that when i mouse over a div it will show and on mouse out it will fade out. the problem is that if you roll over any of the menu's children the menu will disappear(because technically if you're over one of the children then you're not over the parent) is there a way so that rolling over the children will not count as a mouseout? here is my code: http://jsfiddle.net/32bLg/

解决方案

This is a very simple problem most people tend to massively overcomplicate with timers and special case checks. The easy solution is via markup. Place both hover target and the menu under the same parent, and track hover on the parent. Like this. You may also want to use hoverIntent jQuery plugin to avoid false hover events.

A UX note: fade animations lasting over 500ms are just rude. Please don't do that.

这篇关于jquery菜单盘旋的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆