我一直在尝试调试为什么js链接无法正常工作。使用控制台,但我似乎看不到有什么问题。任何人都可以和我分享他们的调试工作流程。或者帮我找到看不见的问题。
CodePen-可以工作,但是在网站上我似乎找不到冲突!谁能帮忙。
这是site-在网站上,请点击屏幕底部的小册子按钮。
jQuery
$("a[href='#brochure'], .close-overlay").on("click", (e) => {
e.preventDefault();
$(".overlay").toggleClass("show");
});
按钮
<a href="#brochure" class="btn-orange fixedsticky-btn mb-05x">Brochure</a>
重叠
<div class="overlay show">
<div class="overlay-inner">
<span class="close-overlay"><div class="close-icon">
<!--?xml version="1.0" encoding="UTF-8"?-->
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>close</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Boostrap3-Grid" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Gallery-Overlay-Desktop-1280" transform="translate(-1274.000000, -20.000000)">
<g id="close" transform="translate(1274.000000, 20.000000)">
<path d="M30,15 C30,23.284 23.284,30 15,30 C6.716,30 0,23.284 0,15 C0,6.716 6.716,0 15,0 C23.284,0 30,6.716 30,15" id="Fill-1" fill="#5F6062"></path>
<path d="M8.0596,8.0596 L21.9406,21.9406" id="Stroke-3" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round"></path>
<path d="M21.9404,8.0596 L8.0594,21.9406" id="Stroke-5" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round"></path>
</g>
</g>
</g>
</svg>
</div>
</span>
<div class="mb-1x">
<h2>Download a brochure</h2>
<a href="" download="" class="btn-orange btn-fit">Download</a>
</div>
<p>Please contact us to arrange a consultation or receive a sample.</p>
<a href="" class="btn-orange btn-fit">Find out more ></a>
</div>
</div>