Javascript scroll事件在通过Chrome中的脚本(而不是IE9)更改div大小时触发

Javascript scroll事件在通过Chrome中的脚本(而不是IE9)更改div大小时触发,javascript,events,cross-browser,scroll,Javascript,Events,Cross Browser,Scroll,小提琴: 在Chrome中,当内容框的大小通过脚本改变时,它调用一个scroll事件并删除我的scroll helper div 在IE9中,它不会触发这个scroll事件,因此scroll helper div被卡在页面上,不会因为页面没有滚动而消失,但它现在无法触发scroll,因为内容发生了更改 如何在IE9中触发更新 我用的是Durandal所以这是一个水疗中心 html: 必须通过Durandal事件来解决这个问题 如果有人有一个不使用Durandal事件的决议,我认为这将是一个更好的

小提琴:

在Chrome中,当内容框的大小通过脚本改变时,它调用一个scroll事件并删除我的scroll helper div

在IE9中,它不会触发这个scroll事件,因此scroll helper div被卡在页面上,不会因为页面没有滚动而消失,但它现在无法触发scroll,因为内容发生了更改

如何在IE9中触发更新

我用的是Durandal所以这是一个水疗中心

html:


必须通过Durandal事件来解决这个问题

如果有人有一个不使用Durandal事件的决议,我认为这将是一个更好的答案,即使你没有使用Durandal,它也会起作用

//fix for IE9, because the final scroll event is not fired when the page size changes
_i.router.on('router:navigation:composition-complete').then(function (instance, instruction, router) {
    $fade.toggle((_i.$(window).scrollTop() > 0));
});

IE10和FF也像Chrome一样工作,只是当滚动条消失时IE9不会触发滚动事件
var $fade = $('.scrollerfade');
$(window).on('scroll', function () {
    $fade.toggle(($(window).scrollTop() > 0));
});
$('.content').on('click',function(){
    $(this).height(($(this).height()>200)?200:2000);
});
//fix for IE9, because the final scroll event is not fired when the page size changes
_i.router.on('router:navigation:composition-complete').then(function (instance, instruction, router) {
    $fade.toggle((_i.$(window).scrollTop() > 0));
});