怎样定位HTML页面滚动条的位置?

zhaofr1981 2003-02-14 10:30:58
怎样定位HTML页面滚动条的位置?
...全文
761 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsj 2003-02-14
  • 打赏
  • 举报
回复
先试一下这个,再说嘛
.....
....
....
<input id=goHere value="滚动到我这里" onclick="this.scrollIntoView()">
zhaofr1981 2003-02-14
  • 打赏
  • 举报
回复
看不懂,能简单点吗?
wsj 2003-02-14
  • 打赏
  • 举报
回复
scrollTo Method

--------------------------------------------------------------------------------

Scrolls the window to the specified x- and y-offset.

Syntax

window.scrollTo(iX, iY)
Parameters

iX Required. Integerhat specifies the horizontal scroll offset, in pixels.
iY Required. Integerhat specifies the vertical scroll offset, in pixels.

Return Value

No return value.

Remarks

The specified offsets are relative to the upper-left corner of the window.



scroll Method

--------------------------------------------------------------------------------

Causes the window to scroll to the specified x- and y-offset at the upper-left corner of the window.

Syntax

window.scroll(iX, iY)
Parameters

iX Required. Integerhat specifies the horizontal scroll offset, in pixels.
iY Required. Integerhat specifies the vertical scroll offset, in pixels.

Return Value

No return value.

Remarks

This method is provided for backward compatibility only. The recommended way to scroll a window is to use the scrollTo method.

scrollBy Method

--------------------------------------------------------------------------------

Causes the window to scroll relative to the current scrolled position by the specified x- and y-pixel offset.

Syntax

window.scrollBy(iX, iY)
Parameters

iX Required. Integerhat specifies the horizontal scroll offset, in pixels. Positive values scroll the window right, and negative values scroll it left.
iY Required. Integerhat specifies the vertical scroll offset, in pixels. Positive values scroll the window down, and negative values scroll it up.

Return Value

No return value.
wsj 2003-02-14
  • 打赏
  • 举报
回复
.....
....
....
<input id=goHere value="滚动到我这里" onclick="this.scrollIntoView()">

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧