当前位置: 技术问答>java相关
怎样用script实现某段html随滚动条滚动的效果?最好能给源代码?或者给出能看到源代码的链接也可以
来源: 互联网 发布时间:2015-03-06
本文导语: | In Netscape Navigator 3 you can use the window.scroll(x,y) method to do this. In Netscape Navigator 4 this has been deprecated and replaced with window.scrollTo() and window.scrollBy(): scrollBy(horizontal, vertical) horizontal - The number...
|
In Netscape Navigator 3 you can use the window.scroll(x,y) method to do this.
In Netscape Navigator 4 this has been deprecated and replaced with window.scrollTo() and window.scrollBy():
scrollBy(horizontal, vertical)
horizontal - The number of pixels by which to scroll the viewing area horizontally.
vertical - The number of pixels by which to scroll the viewing area vertically.
scrollTo(x-coordinate, y-coordinate)
x-coordinate - An integer representing the x-coordinate of the viewing area in pixels.
y-coordinate - An integer representing the y-coordinate of the viewing area in pixels.
To scroll another frame you need to go via the parent frame, e.g.:
parent.frameName.scrollTo(0,500)
which will scroll the frame frameName to 500 pixels from the top of the document.
In Netscape Navigator 4 this has been deprecated and replaced with window.scrollTo() and window.scrollBy():
scrollBy(horizontal, vertical)
horizontal - The number of pixels by which to scroll the viewing area horizontally.
vertical - The number of pixels by which to scroll the viewing area vertically.
scrollTo(x-coordinate, y-coordinate)
x-coordinate - An integer representing the x-coordinate of the viewing area in pixels.
y-coordinate - An integer representing the y-coordinate of the viewing area in pixels.
To scroll another frame you need to go via the parent frame, e.g.:
parent.frameName.scrollTo(0,500)
which will scroll the frame frameName to 500 pixels from the top of the document.
|
The scrollBy method introduced in Netscape Navigator 4 and Internet Explorer 4 allows the document to be scrolled in increments. With the assitance of a timer you can scroll all the way down to the bottom of a document:
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。