2
我有一個頁面,包含各個部分和指向這些部分的鏈接。我已經實現滾動動畫與以下:平滑滾動動畫到Windows Phone上的IE頁面部分
$(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
}, 1000);
return false;
}
}
});
});
這工作完全在Chrome,Safari瀏覽器,火狐和iOS 7和Android,但在Windows Phone(8與IE)的滾動是生澀的頂部部分已經出來。
任何想法如何使其工作?