点击这里给我发消息 点击这里给我发消息
首页 > 行业资讯 > HTML>详细内容

ie火狐都兼容的上下浮动

添加时间:2010-6-8
    相关阅读: 网页
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>ie火狐都兼容的上下浮动</title><link rel="stylesheet" type="text/css"> </head> <table width="100%" height="1500" border="0" cellspacing="0" cellpadding="0"> <tr> <td> 网页内容</td> </tr> </table> <script> var online= new Array(); if (!document.layers) document.write('<div id="divStayTopLeft" style="position:absolute"> ') </script> <layer id="divStayTopLeft"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> 浮动内容</td> </tr> </table> </layer> <script type="text/javascript"> //Enter "frombottom" or "fromtop" var verticalpos="frombottom" if (!document.layers) document.write('</div> ') function JSFX_FloatTopDiv() { var startX =screen.width-180, startY = 250; var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; if(d.layers)el.style=el; el.sP=function(x,y){this.style.left=x;this.style.top=y;}; el.x = startX; if (verticalpos=="fromtop") el.y = startY; else{ el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; el.y -= startY; } return el; } window.stayTopLeft=function() { if (verticalpos=="fromtop"){ var pY = ns ? pageYOffset : document.body.scrollTop; ftlObj.y += (pY + startY - ftlObj.y)/8; } else{ var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; ftlObj.y += (pY - startY - ftlObj.y)/8; } ftlObj.sP(ftlObj.x, ftlObj.y); setTimeout("stayTopLeft()", 10); } ftlObj = ml("divStayTopLeft"); stayTopLeft(); } JSFX_FloatTopDiv(); </script> </html>
咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册