首先欢迎您进入这个帖子
其次 问题是 我是这么写的 大家注意那段红色的部分我注释掉就可以正常运行 不注释掉 死活不是我想要的效果 可是注释掉了我的样式啊 就乱七八糟 特请教高人
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%--<!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" >
<head runat="server">
<title>无标题页</title>
<style>
<!--
.div{
position: absolute;
border: 2px solid red;
background-color: #EFEFEF;
line-height:90px;
font-size:12px;
z-index:1000;
}
-->
</style>
<script type="text/javascript">
function scall(){
document.getElementById("Div").style.top=document.body.scrollTop; alert(document.getElementById("Div").style.top);
document.getElementById("Div").style.left=document.body.scrollLeft;}window.onscroll=scall;
</script></head>
<body >
<form id="form1" runat="server">
<div>
<div id="Div" class="div" style="width:240px; height:90px;" align="center"><a href="http://www.baidu.com"><img src=1.gif /></a></div>
<div style="position: absolute; top: 0; left: 0; width:100px; height:1000px;"></div>
</div>
</form>
</body>
</html>
其次 问题是 我是这么写的 大家注意那段红色的部分我注释掉就可以正常运行 不注释掉 死活不是我想要的效果 可是注释掉了我的样式啊 就乱七八糟 特请教高人
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%--<!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" >
<head runat="server">
<title>无标题页</title>
<style>
<!--
.div{
position: absolute;
border: 2px solid red;
background-color: #EFEFEF;
line-height:90px;
font-size:12px;
z-index:1000;
}
-->
</style>
<script type="text/javascript">
function scall(){
document.getElementById("Div").style.top=document.body.scrollTop; alert(document.getElementById("Div").style.top);
document.getElementById("Div").style.left=document.body.scrollLeft;}window.onscroll=scall;
</script></head>
<body >
<form id="form1" runat="server">
<div>
<div id="Div" class="div" style="width:240px; height:90px;" align="center"><a href="http://www.baidu.com"><img src=1.gif /></a></div>
<div style="position: absolute; top: 0; left: 0; width:100px; height:1000px;"></div>
</div>
</form>
</body>
</html>
解决方案 »
- DropDownList绑定了datasource过后,如何在页面加载的时候获取DropDownList的默认值?
- ★基于手机短信的在线提醒系统的开发——技术求助
- 【求助】asp.net-vs2005,怎么样将一个用户控件显示在网页上?
- MSDN是否要重新安装?
- asp.net页面中调用.js文件的郁闷问题
- 想自做一阅读天极网的RSS文件程序,可是代码有错.高手请帮忙.
- 哪里有vb.net的源码,面向对象做得比较好的源码,学习一下
- 如何快速提高ASP.net的实用水平
- 怎么知道客户端是winnt,2000,或xp,2003等操作系统平台信息!
- 错误号:ORA-06550;如何获取oracle存储过程中游标型TYPE rcsIMPROVE_AIRLINE IS REF CURSOR;的out参数返回的数据集?
- sql达人进
- jQuery读取数据库显示读出来的数据(静态页面)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div style="width:100px;height:100px;position:absolute;right:20px;top:80px;background:#FFCC00;border:1px solid #999;"></div>
<script type="text/javascript">
<!--
var i=0, str="";while(i++<100){str+="<br>"}
document.write(str);
var div = document.getElementsByTagName("div")[0];
var y = parseInt(div.style.top);
setInterval(function(){
var cy = parseInt(div.style.top);
var dy = document.body.scrollTop || document.documentElement.scrollTop;
div.style.top = (cy + (dy -(cy-y))*0.1) + "px";
},10);
//-->
</script>
</body>
</html>