我在https://livingibogaine.squarespace.com的标题中引用了以下脚本。我会单独发布 HTML,但它是多山的。
脚本在 Safari 中触发很棒!Firefox 和 Chrome 根本不阅读它们。我的格式不正确吗?或者这可能是 Squarespace 平台中的一个错误?
<link rel="stylesheet" type="text/css" href="http://www.wlvrtn.com/sites/www.livingcleanibogaine.com/css/style-five.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.wlvrtn.com/sites/www.livingcleanibogaine.com/js/jquery.sticky.js"></script>
<script type="text/javascript">
$(window).load(function(){
$("#page-nav").sticky({ topSpacing: 0 });
});
</script>
<script type="text/javascript">
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 800);
return false;
}
}
});
});
</script>