Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图从这里实现下面的 js :
$("a[href='#top']").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; });
它只是在控制台中产生一个我似乎无法纠正的错误。
问题出在脚本中的其他地方。您的代码在添加}).
})
$("a[href='#top']").click(function() { $("html, body").animate({ scrollTop: 1000 }, "slow"); return false; });
为了修复,我必须清除缓存。您可以在 Firefox 中使用 Web 开发人员工具栏或在 Chrome 中的首选项中执行此操作。