怎么用CSS设置悬浮广告?

我的网站doctorwin点net.试过用CSS的position:fixed来。在我的win7系统下是可以的,但是别人打开的时候却不知跑那里啦。有没人可以帮我解决啊?... 我的网站doctorwin点net.
试过用CSS的position:fixed来。在我的win7 系统下是可以的,但是别人打开的时候却不知跑那里啦。有没人可以帮我解决啊?
展开
 我来答
游乐设备
高粉答主

2015-11-30 · 对事随心,对人随缘。
游乐设备
采纳数:4377 获赞数:82603

向TA提问 私信TA
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Copyright" content="#" />
<meta name="description" content="#" />
<meta content="#" name="keywords" />
<title>11</title>
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id=duilian01 style="POSITION: absolute; TOP: 100px; HEIGHT: 300px; background-color: #069; width: 100px; left: 6px;"></div>
<div id=duilian02 style="POSITION: absolute; TOP: 100px; HEIGHT: 300px; background-color: #069; width: 100px; left: 896px;"></div>
<script language=JavaScript src="js/scrolljs.js" type=text/javascript></script>
<table width="778" height="1000" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f4f4f4">
<tr>
<td></td>
</tr>
</table>
</BODY></HTML>

---------------------------------------下面是JS代码:命名scrolljs.js------------------------------------------
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

var tmp1= tmp2= tmp3 =0;
tmp1 = document.body.clientHeight;

var isArrayRightBanner = false;
var has2ndScraper = false;
if (typeof(duilian02.length) == "number") isArrayRightBanner = true;
if (typeof(duilian01) == "object") has2ndScraper = true;

function makewing()
{
tmp2 = document.body.clientHeight;
if(tmp1 != tmp2){
tmp3 = tmp2 - tmp1;
tmp1 = tmp2;
if(tmp3<0){}
}
if(IE)
{
diffY = document.body.scrollTop;
diffX = 0;
}
else if(NS)
{
diffY = self.pageYOffset;
diffX = self.pageXOffset;
}

if(diffY != lastScrollY)
{
percent = .1 * (diffY - lastScrollY);

if(percent > 0)
percent = Math.ceil(percent);
else
percent = Math.floor(percent);

if(IE)
{
if (isArrayRightBanner)
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelTop += percent;
}
document.all.duilian02[0].style.pixelTop += percent;
document.all.duilian02[1].style.pixelTop += percent;
}
else
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelTop += percent;
}
document.all.duilian02.style.pixelTop += percent;
}
if (has2ndScraper) document.all.duilian01.style.pixelTop += percent;
}
else if(NS)
{
if (isArrayRightBanner)
{
document.skyflash.top += percent;
document.duilian02[0].top += percent;
document.duilian02[1].top += percent;
}
else
{
document.skyflash.top += percent;
document.duilian02.top += percent;
}
if (has2ndScraper) document.duilian01.top += percent;
}

lastScrollY = lastScrollY + percent;
}

if(diffX != lastScrollX)
{
percent = .1 * (diffX - lastScrollX);

if(percent > 0)
percent = Math.ceil(percent);
else
percent = Math.floor(percent);

if(IE)
{
if (isArrayRightBanner)
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelLeft += percent;
}
document.all.duilian02[0].style.pixelLeft += percent;
document.all.duilian02[1].style.pixelLeft += percent;
}
else
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelLeft += percent;
}
document.all.duilian02.style.pixelLeft += percent;
}
if (has2ndScraper) document.all.duilian01.style.pixelLeft += percent;
}
else if(NS)
{
if (isArrayRightBanner)
{
document.skyflasy.top += percent;
document.duilian02[0].top += percent;
document.duilian02[1].top += percent;
}
else
{
document.skyflash.top += percent;
document.duilian02.top += percent;
}
if (has2ndScraper) document.duilian01.top += percent;
}
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("makewing()",1);
单独建一个文件夹命名js,把js文件放入文件夹内,防止路径不对出错。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2010-12-02
展开全部
建议你在网上另找一段js代码来实现吧
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
lp5276159be1
2010-12-14 · TA获得超过2万个赞
知道大有可为答主
回答量:1万
采纳率:39%
帮助的人:4318万
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Copyright" content="#" />
<meta name="description" content="#" />
<meta content="#" name="keywords" />
<title>11</title>
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id=duilian01 style="POSITION: absolute; TOP: 100px; HEIGHT: 300px; background-color: #069; width: 100px; left: 6px;"></div>
<div id=duilian02 style="POSITION: absolute; TOP: 100px; HEIGHT: 300px; background-color: #069; width: 100px; left: 896px;"></div>
<script language=JavaScript src="js/scrolljs.js" type=text/javascript></script>
<table width="778" height="1000" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f4f4f4">
<tr>
<td></td>
</tr>
</table>
</BODY></HTML>

---------------------------------------下面是JS代码:命名scrolljs.js------------------------------------------
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

var tmp1= tmp2= tmp3 =0;
tmp1 = document.body.clientHeight;

var isArrayRightBanner = false;
var has2ndScraper = false;
if (typeof(duilian02.length) == "number") isArrayRightBanner = true;
if (typeof(duilian01) == "object") has2ndScraper = true;

function makewing()
{
tmp2 = document.body.clientHeight;
if(tmp1 != tmp2){
tmp3 = tmp2 - tmp1;
tmp1 = tmp2;
if(tmp3<0){}
}
if(IE)
{
diffY = document.body.scrollTop;
diffX = 0;
}
else if(NS)
{
diffY = self.pageYOffset;
diffX = self.pageXOffset;
}

if(diffY != lastScrollY)
{
percent = .1 * (diffY - lastScrollY);

if(percent > 0)
percent = Math.ceil(percent);
else
percent = Math.floor(percent);

if(IE)
{
if (isArrayRightBanner)
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelTop += percent;
}
document.all.duilian02[0].style.pixelTop += percent;
document.all.duilian02[1].style.pixelTop += percent;
}
else
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelTop += percent;
}
document.all.duilian02.style.pixelTop += percent;
}
if (has2ndScraper) document.all.duilian01.style.pixelTop += percent;
}
else if(NS)
{
if (isArrayRightBanner)
{
document.skyflash.top += percent;
document.duilian02[0].top += percent;
document.duilian02[1].top += percent;
}
else
{
document.skyflash.top += percent;
document.duilian02.top += percent;
}
if (has2ndScraper) document.duilian01.top += percent;
}

lastScrollY = lastScrollY + percent;
}

if(diffX != lastScrollX)
{
percent = .1 * (diffX - lastScrollX);

if(percent > 0)
percent = Math.ceil(percent);
else
percent = Math.floor(percent);

if(IE)
{
if (isArrayRightBanner)
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelLeft += percent;
}
document.all.duilian02[0].style.pixelLeft += percent;
document.all.duilian02[1].style.pixelLeft += percent;
}
else
{
if (document.all.skyflash != null) {
document.all.skyflash.style.pixelLeft += percent;
}
document.all.duilian02.style.pixelLeft += percent;
}
if (has2ndScraper) document.all.duilian01.style.pixelLeft += percent;
}
else if(NS)
{
if (isArrayRightBanner)
{
document.skyflasy.top += percent;
document.duilian02[0].top += percent;
document.duilian02[1].top += percent;
}
else
{
document.skyflash.top += percent;
document.duilian02.top += percent;
}
if (has2ndScraper) document.duilian01.top += percent;
}
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("makewing()",1);
单独建一个文件夹命名js,把js文件放入文件夹内,防止路径不对出错
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
一川CqI26
2019-09-05
知道答主
回答量:2
采纳率:0%
帮助的人:1378
展开全部
.div1{
position: fixed;
top:100px;
left:100px;
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
武大浪
2010-12-01 · TA获得超过124个赞
知道答主
回答量:167
采纳率:100%
帮助的人:27.5万
展开全部
不兼容的东西不要用。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(3)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式