请问如何控制页面,让屏幕显示页面想要呈现的部分,而不是从顶部开始? 加个锚链接比如<a name="#4">4楼</a>然后链接这样:www.xxx.com/test.html#4就可以定位到4楼了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 拿到目标OFFSETHEIGHT再设置SCROLL <html><head><script>function a(){var a=document.getElementById('a');window.scroll(0,a.offsetTop)}</script></head><body onload="a()"><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input type='text' value='100' /><BR><input id='a' type='text' value='100' /><BR></body></html>刚刚说错了...OFFSETTOP才对. 其实我的本意是这样的,可能举得例子不够恰当。我写了个视频的网页左侧是视频,右侧是按视频播放的时间升序排列的评论(在style="overflow-y: scroll"里面),我想实现:拖动视频的播放条到某一时间时,右侧评论跟着居中显示出来。现在,拖动拖动视频的播放条后的时间已经被我捕获到了,问题是如何根据这个时间(亦即评论部分的播放时间)把对应的这条评论在style="overflow-y: scroll"里面居中显示。如果刷新页面,视频就停了。。 加个锚链接 比如 <a name="#4">4楼 </a> 然后链接这样: www.xxx.com/test.html#4 就可以定位到4楼了. 如何确保标签<a>执行onclick事件后执行href JS中的scroll client offset等定位属性! 用javascript读取注册表问题 window.showModalDialog 子页面显示出现滚动条 关于改变表格行顺序的问题 我怎样判断用户关闭了js功能????????????????? 高分,求一段代码! 如何获取浏览器的尺寸呢? 一个较难的问题,如何在下拉列表中用不同的颜色显示不同的item? SOS 怎么使用JavaScript删除脱机文档,并刷新页面???求救!!! 关闭子窗体同事刷新父窗体。 关于Unicode编码与解码问题
再设置SCROLL
<head>
<script>
function a(){
var a=document.getElementById('a');
window.scroll(0,a.offsetTop)
}</script>
</head>
<body onload="a()">
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input type='text' value='100' /><BR>
<input id='a' type='text' value='100' /><BR>
</body>
</html>刚刚说错了...OFFSETTOP才对.
我写了个视频的网页
左侧是视频,右侧是按视频播放的时间升序排列的评论(在style="overflow-y: scroll"里面),我想实现:拖动视频的播放条到某一时间时,右侧评论跟着居中显示出来。现在,拖动拖动视频的播放条后的时间已经被我捕获到了,问题是如何根据这个时间(亦即评论部分的播放时间)把对应的这条评论在style="overflow-y: scroll"里面居中显示。如果刷新页面,视频就停了。。
<a name="#4">4楼 </a>
然后链接这样: www.xxx.com/test.html#4 就可以定位到4楼了.