[英]How do I hover over the menu button and the selections appear?
What's Wrong with this jquery if I want to: Hover over #menu
(the whole thing) and then all the other menu selections appear beneath that. 如果需要,此jquery有什么问题:将鼠标悬停在#menu
(整个菜单)上,然后所有其他菜单选择都显示在该菜单下。 These selections are .menubox
, but I grouped them all separate from .menuboxSuperior
as #others
. 这些选择是.menubox
,但是我将它们与.menuboxSuperior
分别分组为#others
。 The top box which is always showing (menu) is called .menuboxSuperior.
始终显示(菜单)的顶部框称为.menuboxSuperior.
Also when I hover over the whole thing ( #menu
) I want the opacity to increase from 0.4 to 0.9 in 200ms. 另外,当我将鼠标悬停在整个对象上时( #menu
),我希望不透明度在200毫秒内从0.4增加到0.9。 None of this is working for me. 这些都不对我有用。 What should I do? 我该怎么办?
jQuery: jQuery的:
$(document).ready(function(){
$('.menubox').hide();
$('#menu').mouseenter(function(){
$(this).fadeTo(200 0.9);
});
$('#menu').mouseleave(function(){
$(this).fadeTo(200 0.4);
});
$('#menu').mouseenter(function(){
$('#others').show();
});
$('#menu').mouseleave(function(){
$('#others').hide();
});
});
THANK YOU VERY MUCH! 非常感谢你!
you're missing a comma 您缺少逗号
$(this).fadeTo(200 0.9);
$(this).fadeTo(200 0.4);
should be 应该
$(this).fadeTo(200, 0.9);
$(this).fadeTo(200, 0.4);
most modern browsers have developer tools with a console that will show simple errors like this - firefox shows SyntaxError: missing ) after argument list
in this case, and shows exactly which line in your code you have wrong. 大多数现代的浏览器都具有带有控制台的开发人员工具,该控制台将显示诸如此类的简单错误-在这种情况下,firefox SyntaxError: missing ) after argument list
显示SyntaxError: missing ) after argument list
,并确切显示您在代码中哪一行错了。 If you want to develop, use developer tools 如果要开发,请使用开发人员工具
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.