css监听元素高度

html-css07

css监听元素高度,第1张

css监听元素高度如下。

1、页面渲染完成后(onReady函数里)去获取元素1在页面上距离顶部的高度fixedTop。

2、用监听页面滚动函数onPageScroll得到当前页面滚动高度,高度是页面在垂直防线已滚动的距离(单位px)。

用frameset写,这样适应整个浏览器

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

<title>无标题文档</title>

</head>

<frameset name="bodyFrame" class="bodyFrame" rows="100,*,100" frameborder="no" border="0" scrolling="no" framespacing="0" noresize="noresize">

<frame src="Top.htm" name="TopFrame" scrolling="no" noresize="noresize" />

<frame src="conten.htm" name="contenFrame" scrolling="no" noresize="noresize" />

<frame src="foot.htm" name="footFrame" scrolling="no" noresize="noresize" />

</frameset>

</html>