Jquery 导航步行器菜单移动,切换按钮工作,但子菜单很快消失

Jquery 导航步行器菜单移动,切换按钮工作,但子菜单很快消失,jquery,wordpress,twitter-bootstrap,Jquery,Wordpress,Twitter Bootstrap,我在我的wordpress主题中使用nav walker菜单,它工作得非常好,但在移动设备上有一个小问题,单击切换按钮几秒钟后子菜单项消失 这是我的Jquery,任何帮助都将不胜感激 <script> (function($) { jQuery(function($) { $('.navbar .dropdown').click(function() { $(this).find('.dropdown-menu').first().stop(true, true).slideTo

我在我的wordpress主题中使用nav walker菜单,它工作得非常好,但在移动设备上有一个小问题,单击切换按钮几秒钟后子菜单项消失

这是我的Jquery,任何帮助都将不胜感激

<script>
(function($) {
jQuery(function($) {
$('.navbar .dropdown').click(function() {
  $(this).find('.dropdown-menu').first().stop(true, true).slideToggle();
}, function() {
  $(this).find('.dropdown-menu').first().stop(true, true).slideUp();
});
$('.navbar .dropdown > a').click(function() {   

  location.href = this.href;
   });
   });
   })(jQuery);
  </script>

(函数($){
jQuery(函数($){
$('.navbar.dropdown')。单击(函数(){
$(this).find('.dropdown menu').first().stop(true,true.slideToggle();
},函数(){
$(this).find('.dropdown menu').first().stop(true,true.slideUp();
});
$('.navbar.dropdown>a')。单击(函数(){
location.href=this.href;
});
});
})(jQuery);

为什么要添加jquery?嗨,Manish,是的,我添加了jquery,默认情况下,在NavWalker菜单中,父菜单项不可单击,但我用jquery更改了这一点,现在父菜单项已链接,因此在小屏幕上,当您单击父菜单项时,它会下拉子菜单项,然后将其链接到父菜单链接。。我想在小插入符号上添加切换功能,而不是在父菜单项上?因为我想链接父菜单项,所以我在其中添加了Jquery。你想要的只是一个导航栏??