87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" onscroll="moves()">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> onscroll </title>
<script type="text/javascript">
function moves() {
var peixun=document.getElementById("peixun")
peixun.style.top=document.documentElement.scrollTop + 50 + "px";
peixun.style.left=document.documentElement.scrollLeft + "px";
}
</script>
</head>
<body onselectstart="return false">
<textarea rows="500" cols="500" id="textarea1" name="textarea1">
将文本框设置足够大 就会出现滚动条 这是不动的文字
</textarea>
<a id='peixun' href="http://www.peixun.com" style="position:absolute; left:0; top:50px;"> 跟踪文字 </a>
</body>
</html>