我想跳转到标签,一旦页面上的一切加载。早些时候它工作得很好,但是一旦我在页面上添加了flexslider,代码就不能正常工作了。以下是代码
$(window).bind("load", function() {
var hash = window.location.hash;
if(hash) {
console.log(hash);
var hashlink = hash.replace('#_', '#');
console.log(hashlink);
$('html, body').animate({
scrollTop: $(hashlink).offset().top - 50
}, 200);
}
});发布于 2015-11-15 16:20:13
这个怎么样:
document.addEventListener('DOMContentLoaded', function() {
//your init function
}, false);https://stackoverflow.com/questions/33717467
复制相似问题