六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 204|回复: 0

兼容比较好的一个浮动层代码.css xhtml

[复制链接]

升级  82.4%

290

主题

290

主题

290

主题

进士

Rank: 4

积分
912
 楼主| 发表于 2013-2-8 00:28:31 | 显示全部楼层 |阅读模式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank" rel="external">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"><html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank" rel="external">http://www.w3.org/1999/xhtml</a>"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><!--***********开始*************--><script type="text/javascript">//<![CDATA[var tips; var theTop = 200/*这是默认高度,越大越往下*/; var old = theTop;function initFloatTips() {  tips = document.getElementById('floatTips');  moveTips();};function moveTips() {  var tt=50;  if (window.innerHeight) {    pos = window.pageYOffset  }  else if (document.documentElement && document.documentElement.scrollTop) {    pos = document.documentElement.scrollTop  }  else if (document.body) {    pos = document.body.scrollTop;  }  pos=pos-tips.offsetTop+theTop;  pos=tips.offsetTop+pos/10;  if (pos < theTop) pos = theTop;  if (pos != old) {    tips.style.top = pos+"px";    tt=10;  }  old = pos;  setTimeout(moveTips,tt);}//!]]></script><style type="text/css">div#floatTips{ position:absolute; border:solid 1px #777; padding:3px; top:250px; left:500px; width:300px; background:#cccccc; color:white;}</style></head><body ><div id="floatTips"> 浮动层</div><!--**********结束***************--><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F7F7F7">  <tr>    <td height="2101"> </td>  </tr></table></body></html>

转自:http://www.lioil.net/LBS/article.asp?id=418
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表