这段代码用于在用户向下滚动页面时突出显示菜单上的链接。它在除ie8之外的所有其他浏览器中工作正常(尚未在ie9中进行过测试)。为什么JQuery代码不能在IE上运行? (在其他浏览器上完美工作)
$(document).scroll(function(e){
var trigger = $(this).scrollTop() + $(window).height()/2;
function highlighter(){
var thisId = this.id;
if(
$(this).offset().top <= trigger &&
$(this).offset().top + $(this).outerHeight()>= trigger
) {
$(".main-menu a[href='#" + thisId + "']").addClass("highlighter");
} else {
$(".main-menu a[href='#" + thisId + "']").removeClass("highlighter");
}
};
$("#home, #about, #skills, #work, #blog, #contact").each(highlighter);
});
我想知道是否有任何功能/功能在这里是不支持的IE?或者是否有任何不被IE支持的代码?
谢谢
正常工作有什么版本的jQuery ? – j08691 2014-08-30 04:19:08
对不起!我正在使用Jquery 1.8.3。 – Praadhaan 2014-08-30 05:43:35