StupidBeauty
Read times:2051Posted at: - no title specified

Javascript文档翻译:Window.scroll()

内容目录

概述

语法

参数

示例

注意

概述

将窗口滚动到文档中特定的位置。

语法

window.scroll( x-coord , y-coord )

参数

  • •. x-coord ,水平方向上,在文档中,妳想要将其显示在左上角的那个点的像素偏移值。

  • •. y-coord ,竖直方向上,在文档中,妳想要将其显示在左上角的那个点的像素偏移值。

示例

<!-- 将竖直方向上第 100 个像素放置在窗口的顶部 -->

< button onClick =" scroll(0, 100); ">点击 以向下滚动 100 个像素 </ button >

注意

window.scrollTo 与此方法作用相同。若想重复地滚动特定的距离,则使用 window.scrollBy 。另外请参考 window.scrollByLines window.scrollByPages

瑞秋

瑞秋

瑞秋

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands