怎么用CSS设置悬浮广告?
我的网站doctorwin点net.试过用CSS的position:fixed来。在我的win7系统下是可以的,但是别人打开的时候却不知跑那里啦。有没人可以帮我解决啊?...
我的网站doctorwin点net.
试过用CSS的position:fixed来。在我的win7 系统下是可以的,但是别人打开的时候却不知跑那里啦。有没人可以帮我解决啊? 展开
试过用CSS的position:fixed来。在我的win7 系统下是可以的,但是别人打开的时候却不知跑那里啦。有没人可以帮我解决啊? 展开
5个回答
展开全部
<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文件放入文件夹内,防止路径不对出错。
<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代码来实现吧
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<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文件放入文件夹内,防止路径不对出错
<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文件放入文件夹内,防止路径不对出错
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
.div1{
position: fixed;
top:100px;
left:100px;
}
position: fixed;
top:100px;
left:100px;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不兼容的东西不要用。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询