我需要在我的网站上使用Adirondack模板创建一个jquery按部件,我通过代码注入将jquery cdn代码添加到头部。但是,这会使徽标不显示。我也尝试将cdn jquery代码添加到页脚,并没有区别。 (虽然cdn jquery使我的小部件工作。)徽标显示没有jquery cdn代码。有谁知道如何避免这种冲突?
以下是我正在处理的网站: https://shara-karasic-4b4j.squarespace.com/
这是我正在使用的jquery cdn:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
答案 0 :(得分:0)
我想出来了。这不起作用的原因是这部分jquery代码是冲突的,导致徽标消失。我删除了它,它工作了!
//logo top
$(document).ready(function(){
$("h1, #social-icons").hide();
$(window).scroll(function(){
var height = $(window).scrollTop(); //pour calculer la position de la barre verticale
if( height >= 200) {
$("h1, #social-icons").fadeIn(300);
}
else{ //sinon
$("h1, #social-icons").fadeOut(300);
}
}); //fin de window scroll
}); //fin de doc ready