jQuery滚动以锚定在Internet Explorer上不起作用

问题描述

| 我是javascript和jquery的新手。我正在使用一些预制的东西放在我的网站上。 http://brainscuker.altervista.org/ 当我单击链接向下滚动到锚点时,它最初会转到正确的位置,但不久之后,它将向上滚动。 在Firefox和Chrome上效果很好。 我正在使用的脚本是这个。
$(document).ready(function() {
  $(\"a.who\").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

settings = jQuery.extend({
    speed : 800
},settings);   

return this.each(function(){
    var caller = this
    $(caller).click(function (event) {  
        event.preventDefault()
        var locationHref = window.location.href
        var elementClick = $(caller).attr(\"href\")

        var destination = $(elementClick).offset().top;
        $(\"html:not(:animated),body:not(:animated)\").animate({ scrollTop: destination},settings.speed,function() {
            window.location.hash = elementClick
        });
        return false;
    })
})
}
thx任何最终的帮助!     

解决方法

window.location.hash在IE上存在错误。当前正在解决类似问题,必须使用scroll或scrollTo函数使其起作用。     

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...