我有一个基于Bootstrap 4.1的HTML网页,在该网页中,我使用以下脚本在其他页面中重用了HTML代码; 演示页面可以在这里看到 http://skillsteer.com/clients/didx/
<script>
$(function(){
$('#header').load('header.html');
$('#footer').load('footer.html');
});
在使用此脚本之前,基于引导程序的移动菜单可以完美打开,但是使用后,该菜单停止工作并且根本无法打开。
请帮助我解决此问题。 谢谢, 法汉
答案 0 :(得分:0)
因为在连接移动菜单点击处理程序之前尚未加载header.html。选择以下两个选项之一:
$('#header').load('header.html', function() {
$('.resposive_menu_bar').click(function(){
$('.menu').children('ul').slideToggle(300);
});
});