从 scrollTop 到 clientHeight+scrollTop 当前显示的纵坐标范围
解决方案 »
- 请问ext报这个错误是怎么回事
- 关于一段js代码优化问题
- 非常简单的下拉菜单实现请教
- select无法响应双击事件?
- 麻烦介绍一本JavaScript的经典教程,最好可用于查询,谢谢!
- 如何将HTML格式的内容转换成纯TEXT格式,反之又如何做?
- javascript能返回客户端机器名或IP地址吗??急!!
- 我用window.close()关闭当前页,在IE中工作正常,但在Netscape中无效,请问应该如何写?
- 求显示值判断语句写法
- Echarts的map在谷歌、IE下可以正常显示,火狐不显示,问题可能出在哪里?
- 怎样使子窗口获得焦点?
- JavaScript中有没有函数是去掉字符串两边空格的函函数啊?
row.style.position="absolute";
if((row.*** >document.body.scrollTop)&&
(row.***<document.body.clientHeight+document.body.scrollTop))
{ row 可见。
}我想知道这个row.***到底应该是tr的什么属性。谢谢。
<html>
<script type="text/javascript">
<!--
window.onscroll=do_scroll;
function do_scroll(){
canView();
}function canView(){ var row =document.getElementById("firstRow");
row.style.position="absolute";
if((row.scrollTop >document.body.scrollTop)&&
(row.scrollTop<document.body.clientHeight+document.body.scrollTop))
{
alert("ok"+row.scrollTop);
}else{
alert("no"+row.scrollTop);
}}
//-->
</script>
<body >
<br>
<br>
<br>
<br>
<input type ="text" name ="t" id="t"/>
<table border="1" id="tb" cellpadding="2" cellspacing="0">
<tr id = "firstRow" bgColor="red">
<th>
name
</th>
<th>
value
</th>
<th>
meaning
</th>
</tr>
<tr>
<th>
<code>
src
</code>
</th>
<td>
<code>
"
</code>
<var>
URL
</var>
<code>
"
</code>
</td>
<td>
the address of the initial content for the inline frame
</td>
</tr>
<tr>
<th>
<code>
name
</code>
</th>
<td>
<code>
"
</code>
<var>
string
</var>
<code>
"
</code>
</td>
<td>
assigns a name to the inline frame, for
<a href="#target"> use in
<code>
target
</code>
attribute</a>
</td>
</tr>
<tr>
<th>
<code>
longdesc
</code>
</th>
<td>
<code>
"
</code>
<var>
URL
</var>
<code>
"
</code>
</td>
<td> refers to a document containing a description (not supported yet)
</td>
</tr>
<tr>
<th>
<code>
width
</code>
</th>
<td rowspan="2">
number of pixels or percentage (e.g.
<code>
"20%"
</code> )
</td>
<td>
width of the inline frame; see
<a href="#dim" title="Dimensions"> notes below</a>
</td>
</tr>
<tr>
<th>
<code>
height
</code>
</th>
<td>
height of the inline frame; see
<a href="#dim" title="Dimensions"> notes below</a>
</td>
</tr>
<tr>
<th rowspan="5">
<code>
align
</code>
</th>
<td>
<code>
"top"
</code>
</td>
<td> aligns the inline frame vertically on the top of the surrounding
content on its left and right
</td>
</tr>
<tr>
<td>
<code>
"bottom"
</code>
</td>
<td> aligns the inline frame vertically on the bottom of the
surrounding content on its left and right
</td>
</tr>
<tr>
<td>
<code>
"middle"
</code>
</td>
<td> aligns the center of the inline frame vertically with the current
baseline
</td>
</tr>
<tr>
<td>
<code>
"left"
</code>
</td>
page content flows on the right of it
</td>
</tr>
<tr>
<td>
<code>
"right"
</code>
</td>
<td> places the inline frame at the right margin so that subsequent
page content flows on the left of it
</td>