前辈,后生有一事相求:怎么试验 静态网页 浮动 广告啊
各位大师:我有一则代码 可以实现<html>
<head>
<title>制作浮动的广告图片</title>
<script language="javascript" type="text/javascript">
//使层总置于顶端的初始值
var advInitTop=0;
var closeInitTop=0;
//获取广告图片所在的层上边距的初始值
function inix()
{
advInitTop=parseInt(window.document.getElementById("advLayer").style.top);
closeInitTop=parseInt(window.document.getElementById("closeLayer").style.top);
}
//使用广告图片所在的层与滚动条同步移动
function move()
{
document.getElementById("advLayer").style.top=advInitTop+parseInt(window.document.body.scrollTop);
document.getElementById("closeLayer").style.top=closeInitTop+parseInt(window.document.body.scrollTop);
}
//隐藏advLaayer closeLayer 并不为被隐藏的对象保留其物理空间
function closeMe()
{
window.document.getElementById("closeLayer").style.display="none";
window.document.getElementById("advLayer").style.display="none";
}
//窗口的滚动事件,当页面滚动时调用move()函数
window.onscroll=move;
</script>
</head>
<body onLoad="inix()">
<div id="advLayer" style="position:absolute;left:16px;top:80px;width:302px;height:171px; z-index:1;">
<embed src="guanggao.swf" width="260" height="171">
</div>
<div id="closeLayer" onClick="closeMe()"style="position:absolute;left:214px;top:230px;width:27px;height:19px;z-index:2;">
<img src="images/close.gif" alt="close" height="42"/></div>
</body>
</html>
但头上加上:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(这句是Dreamweaver 自动生成的)
功能就消失了 我都哭了。。。。。。。
我是在已有的网页上加广告,要去掉了:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
页面就乱了
为什么吗?多了那句自动生成的代码就不行啊,
如何在:[color=#FF0000]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[color=#0000FF]
有情况下 实现 浮动广告框呢(那种可以随着鼠标 往下移动的,就是仅Y轴 变)
我先在这里候着。。。。。。。。。。。。 --------------------编程问答-------------------- 不好意思 写错了 是怎么实现 静态网页 浮动框 --------------------编程问答-------------------- div漂浮
var ww="窗口"宽度;
var wh="窗口"高度;
function moveWindow(winname)
{
var h1 = document.body.clientHeight;
var h2 = document.documentElement.clientHeight;
var isXhtml = (h2 <=h1&&h2!=0)?true:false;
var body = isXhtml?document.documentElement:document.body;
var o=document.getElementById(winname);
var lf=(body.clientWidth-ww)/2-50;
o.style.left=lf+"px";
o.style.top=(document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) +
((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight)
-wh-200+'px';
if(o.style.display=="")
setTimeout("moveWindow('"+winname+"')",20);
}
function closewindow()
{
document.getElementById("login").style.display="none";
document.getElementById("opwindow").style.display="none";
}
function overclose(o)
{
o.style.backgroundColor="#F6F2EA";
o.style.color="#F10000";
}
function outclose(o)
{
o.style.backgroundColor="#D4D0C8";
o.style.color="#000000";
}
http://topic.csdn.net/u/20100320/20/34b6df08-1a01-4873-860a-f71d11639b1f.html
补充:.NET技术 , ASP.NET