想要自动隐藏菜单面板 [英] Want to auto hide menu panel
问题描述
我们有一项任务是制作谁眨了眨眼我的动员 [ ^ ]响应......我们已经做了所有的事情,但剩下一个。
我们想做的菜单面板自动隐藏任何菜单selecetd。
我尝试过:
我们非常努力,但我们没有达到目标....
We are given a task to make Who Winked Me[^] responsive..we have done all the things but one is left.
we want to make the menu panel auto hide when any menu is selecetd.
What I have tried:
we worked very hard on this but we didn't reach to the goal....
推荐答案
我刚检查了你的代码: http://www.whowinkedme.com/wp-content/themes/winked-child/ js / scripts.js [ ^ ]
我可以看到你使用下面的代码关闭了正文点击菜单: -
I just checked your code present here : http://www.whowinkedme.com/wp-content/themes/winked-child/js/scripts.js[^]
I can see you have used the below code for closing the menu on body click :-
(。sidr-open#main-nav)。clic k();
(".sidr-open #main-nav").click();
因此,您可以执行以下操作来达到您想要的效果。
1.添加hideMenu();所有菜单列表的onclick方法如下: -
So, you can do the following to achieve the one you want.
1. Add hideMenu(); onclick method for all your menu list like :-
<a href="#Home" onclick="hideMenu();">...</a>
<a href="#About" onclick="hideMenu();">...</a>
<a href="#Share" onclick="hideMenu();">...</a>
<a href="#Screenshots" onclick="hideMenu();">...</a>
<a href="#Download" onclick="hideMenu();">...</a>
<a href="#Video" onclick="hideMenu();">...</a>
<a href="#Contact" onclick="hideMenu();">...</a>
2.然后添加hideMenu()函数的定义,如: -
2. Then add the definition for hideMenu() function like :-
<script>
function hideMenu() {
(。sidr-open#main-nav)。click();
}
< / script>
(".sidr-open #main-nav").click(); } </script>
完成!!现在菜单栏会自动隐藏选择列表中的任何菜单。
希望这会对你有帮助:)。
Done !! Now the menu bar will hide automatically on selecting any of the menu in the list.
Hope this will help you :).
这篇关于想要自动隐藏菜单面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!