如何使用Jquery淡入垂直菜单子项
这是我的垂直菜单 如果将鼠标悬停在名为folders的菜单项上,则不会发生任何情况。但是,如果转到菜单项应该出现的位置(“folder”菜单项的右侧),jquery将在子菜单项中淡出。当用户将鼠标悬停在父“文件夹”菜单项上时,如何使其淡入 已编辑 我为没有以正确的方式提问而道歉。这是我应该发布的原始代码。非常感谢CasperOne和Beating向我展示了我的错误 $(文档).ready(函数(){ 有关工作示例,请参阅如何使用Jquery淡入垂直菜单子项,jquery,css,superfish,Jquery,Css,Superfish,这是我的垂直菜单 如果将鼠标悬停在名为folders的菜单项上,则不会发生任何情况。但是,如果转到菜单项应该出现的位置(“folder”菜单项的右侧),jquery将在子菜单项中淡出。当用户将鼠标悬停在父“文件夹”菜单项上时,如何使其淡入 已编辑 我为没有以正确的方式提问而道歉。这是我应该发布的原始代码。非常感谢CasperOne和Beating向我展示了我的错误 $(文档).ready(函数(){ 有关工作示例,请参阅 $(document).ready(function(){
$(document).ready(function(){
//Set the anchor link opacity to 0 and begin hover function
$("ul.child").parent().hover(function(){
//Fade to an opacity of 1 at a speed of 200ms
$(this).find("ul.child").stop().animate({"opacity" : 1}, 200);
//On mouse-off
}, function(){
//Fade to an opacity of 0 at a speed of 100ms
$(this).find("ul.child").stop().animate({"opacity" : 0}, 100);
});
});
不知道为什么会关闭或否决。这个问题是通过一个JSFIDLE示例提出的,使它不是vaugeIt被否决,因为我忘了在stackoverflow上发布代码。我在这里是个新手。答案很好,出于某种原因Casper关闭了它并否决了它,现在我发布了任何问题。我如何解决这个问题?你应该我会问一个新问题。
$(document).ready(function(){
//Set the anchor link opacity to 0 and begin hover function
$("ul.child").parent().hover(function(){
//Fade to an opacity of 1 at a speed of 200ms
$(this).find("ul.child").stop().animate({"opacity" : 1}, 200);
//On mouse-off
}, function(){
//Fade to an opacity of 0 at a speed of 100ms
$(this).find("ul.child").stop().animate({"opacity" : 0}, 100);
});
});