0
我有以下的jQuery代碼:導航不工作的IE8
$(function() {
$('ul.step-navigation li a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
event.preventDefault();
});
});
它是用來通過頂部導航導航到不同的部分頁面上。它可以在FireFox,Chrome,IE9 +上運行100%,但不會在IE8上運行。
這裏的一些答案建議刪除寬鬆,例如這一個:Trouble implementing Smooth Vertical scrolling with jQuery但它不適用於我的情況。
請幫助,如果你能看到爲什麼這不起作用在IE8?它只是忽略點擊事件。