【发布时间】:2012-01-04 07:03:54
【问题描述】:
我正在做一个后台播放器。当用户单击#play 按钮时,主菜单淡入0.1 以不妨碍视图。但他可以随时使用主菜单,只需将鼠标移到主菜单上并返回不透明度1。当他移开鼠标时,又变透明了。
当用户按下#pause 按钮时,主菜单的不透明度恢复为不透明。但是当他从主菜单中移开鼠标时,不透明度必须保持为 1。
基本上我有这个:
$("#play").click(function() {
$("#menu").fadeTo('slow', 0.1);
$(this).hide();
$('#pause').show();
});
$("#pause").click(function() {
$("#menu").fadeTo('slow', 1);
$(this).hide();
$('#play').show();
});
$("#menu").mouseenter(function() {
$("#menu").fadeTo('slow', 1);
}).mouseleave(function(){
$("#menu").fadeTo( // I want this back to the initial value, which can be 0.1 or 1 );
});
你可以看到它在这里工作: http://luisgustavoventura.com
请提出建议。
【问题讨论】:
标签: jquery default mouseenter mouseleave fadeto