Scrolling can be altered by modifying <em>document.body.scrollTop</em> and <em>document.body.scrollLeft</em>. However, there are drawbacks related to working with these properties:
+
可以修改<em>document.body.scrollTop</em> and <em>document.body.scrollLeft</em>调整滚动条的位置。不过使用这些属性时候,相关细节需要注意:
−
* Both properties return 0 when accessed
+
* 访问时候两个属性都会返回0。
−
* Setting one property resets the other property's scroll position
+
* 设置其中一个属性,会重置另一个属性的位置。
−
In order to set both at the same time (without either resetting to 0), use <em>window.scrollTo</em>.