很简单,你的JS运行的时候你的页面还没有加载完成,所以你的JS代码找不到你的页面元素,就会抛出这个问题Cannot read property 'scrollWidth' of null

相关文章: