[英]jQuery slideDown() on child elements only
forgive me in advance, I ride the javascript short bus :( 请原谅我,我乘坐javascript短巴士:(
I have the following code for a slideDown() / slideUp()
with jQuery on a primary navigation: 我在主导航上有以下带有jQuery的
slideDown() / slideUp()
代码:
//jQuery slideDown for menu dropdowns
$('.menu').addClass('js-enabled')
$('.js-enabled li').hoverIntent(function () {
$(".sub-menu").slideDown('slow');
},
function () {
$(".sub-menu").slideUp('slow');
});
My problem is that the code is not unique to the .sub-menu
's which are children of a given <li>
... Can someone tell me how to make the above code specific to the <li>
element being hovered according to the original $('.js-enabled li').hoverIntent
target? 我的问题是代码不是给定
<li>
子代的.sub-menu
独有的。有人可以告诉我如何使上面的代码特定于要悬停的<li>
元素。原始的$('.js-enabled li').hoverIntent
目标?
* EDIT : Here is the production site, demonstrating the bug where all ".sub-menu"'s are being animated by the effect: http://valeriaentertainment.com.s66112.gridserver.com/ * * 编辑:这是生产站点,演示了通过效果使所有“ .sub-menu”动画化的错误: http : //valeriaentertainment.com.s66112.gridserver.com/ *
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.