我所试图做的如何,一旦你按下另一个按钮
关闭了辅助按钮股利和模仿从第一按钮了slideDown脚本了slideDown一个固定的股利。
一旦页脚按钮被按下它通过推动头向上显示我隐而未现的div (#footerPanel)问题
。一旦您再次单击页脚,它将关闭面板并将标题滑回原位。
一旦您将鼠标悬停在站点导航将显示的按钮上(不包括在JSFiddle中),菜单按钮将如下工作。通过这样做,我希望能够关闭#footerPanel并使标题向下滑动,模仿页脚按钮的关闭功能。
现在发生的事情是,当我点击菜单#footerPanel滑下来,但留在标题卡在推动它的位置。另外,当您移动鼠标时,div滑回。
我该如何解决这个问题?我尝试了一些解决方案,但他们似乎都有相同的结果。
JS的
$('#more').toggle(function(){
//show its submenu
$('#footerPanel').slideDown(500);
$(this).parent().parent().animate({'bottom': "+=400"}, 500);
},
function() {
//hide its submenu
$('#footerPanel').slideUp(500);
$(this).parent().parent().animate({'bottom': "-=400"}, 500);
});
$(document).ready(function(){
$('#menu').hover(function(){
$("#footerPanel").slideToggle();
});
});
这个完美的作品,但如果我改变功能从点击到悬停时,#footerPanel滚动备份@Neil基斯特纳 – bigant841
@ bigant841我在我的答案更新我的jsfiddle。我希望这是你正在寻找的。 –
完美谢谢@尼尔·基斯特纳 – bigant841