简体   繁体   English

Joomla Bootstrap自定义模板中的移动菜单未关闭

[英]Mobile menu doesn't close in Joomla Bootstrap custom template

I built a Joomla template to redesign my company's website's front end. 我建立了一个Joomla模板来重新设计公司网站的前端。 Everything works and it looks nicely. 一切正常,看起来不错。 My only problem now is the mobile menu. 我现在唯一的问题是移动菜单。 It opens up when you click the menu button, but it doesn't close. 单击菜单按钮时,它将打开,但不会关闭。 The only way to get rid of it is to select a link or refresh the page. 摆脱它的唯一方法是选择一个链接或刷新页面。

I know the issue is Joomla uses a custom version of Bootstrap.js but if I include my own standard Bootstrap.js file then everything stops working because conflicting calls to JavaScript happen. 我知道问题是Joomla使用了Bootstrap.js的自定义版本,但是如果我包含自己的标准Bootstrap.js文件,则所有操作都会停止,因为会发生对JavaScript的冲突调用。

Does anything know of a solution to this? 有什么知道的解决方案吗?

The website is www.DriveAndShine.com 该网站是www.DriveAndShine.com

<div id="navbar" style="height: 456px; background-color: rgb(17, 3, 140);" 
  class="navbar-collapse collapse **in**">

class in looks like not removed when you reclicked the menu you can use jQuery hasClass method for #navbar ( please include jquery before running the code ) 重新单击菜单时,类中的类似乎未被删除,您可以对#navbar使用jQuery hasClass方法(请在运行代码之前包含jquery)

if($('#navbar').hasClass('in')) {
   $('#navbar').removeClass('in');
} else {
   $('#navbar').addClass('in');
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM