suspendcode="<DIVid=lovexin1style='Z-INDEX:10;LEFT:6px;POSITION:absolute;TOP:105px;width:100;height:300px;'><imgsrc='images/close.gif'onClick='javascript:window.hide()'width=颼'height=ཊ'border=Ɔ'vspace=Ɖ'alt='關閉對聯廣告汪慎'><EMBEDsrc='images/4rr.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED></DIV>"
document.write(suspendcode);
suspendcode="<則友DIVid=lovexin2style='Z-INDEX:10;LEFT:896px;POSITION:absolute;TOP:105px;width:100;height:300px;'><imgsrc='images/close.gif'onClick='javascript:window.hide()'width=颼'height=ཊ'border=Ɔ'vspace=Ɖ'alt='關閉對聯廣告'><EMBEDsrc='images/4rr.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED></DIV>孫陵槐"
document.write(suspendcode);
//flash格式調用方法
//<EMBEDsrc='flash.swf'quality=highWIDTH=100HEIGHT=300TYPE='application/x-shockwave-flash'id=adwmode=opaque></EMBED>
lastScrollY=0;
functionheartBeat(){
diffY=document.body.scrollTop;
percent=.3*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
elsepercent=Math.floor(percent);
document.all.lovexin1.style.pixelTop+=percent;
document.all.lovexin2.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
functionhide()
{
lovexin1.style.visibility="hidden";
lovexin2.style.visibility="hidden";
}
window.setInterval("heartBeat()",1);
『貳』 如何插入網頁左側插入浮動廣告代碼
<DIV id=img1 style="Z-INDEX: 10; LEFT: 2px; WIDTH: 59px; POSITION: absolute; TOP: 43px; HEIGHT: 50px;
visibility: visible;"><a href="http://www.knowsky.com" target="_blank"><img src="images/fudong.jpg" width="150" height="100" border="0"></a></DIV>
<script >
var xPos = 900;
var yPos = 500;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img1.style.top = yPos;
function changePos()
{
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img1.offsetHeight;
Woffset = img1.offsetWidth;
img1.style.left = xPos + document.body.scrollLeft;
img1.style.top = yPos + document.body.scrollTop;
if (yon)
{yPos = yPos + step;}
else
{yPos = yPos - step;}
if (yPos < 0)
{yon = 1;yPos = 0;}
if (yPos >= (height - Hoffset))
{yon = 0;yPos = (height - Hoffset);}
if (xon)
{xPos = xPos + step;}
else
{xPos = xPos - step;}
if (xPos < 0)
{xon = 1;xPos = 0;}
if (xPos >= (width - Woffset))
{xon = 0;xPos = (width - Woffset); }
}
function start()
{
img1.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume()
{
if(pause)
{
clearInterval(interval);
pause = false;}
else
{
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();</script>
『叄』 左側浮動廣告代碼跟隨頁面滾動,急急急!跪求!!!!
用DOCTYPE聲明文檔類型,然後加如下代碼:
<div id="left_layer" style="position:fixed; top:40px; left:0px;">
<img src="圖片"><br>
<a href="javascript:;" onclick="javascript:document.getElementById('left_layer').style.display='none';">關閉</a>
</div>
如果有共用的頁眉頁腳,或是模版專頁之內的,加進去就可以屬顯示在所有頁了.如果沒有,就一頁頁的加吧.
『肆』 懸浮廣告代碼,帶鏈接的
這是左側漂浮的廣告代碼
<SCRIPT FOR=window EVENT=onload LANGUAGE="javascript">
initAd();//載入頁面後,調用函數initAd()
</SCRIPT>
<script language="javascript">
<!--
function initAd() {
document.all.AdLayer.style.posTop = -200;
//設置onLoad事件激發以後,廣告層相對於固定後的y方向位置
document.all.AdLayer.style.visibility = 'visible'//設置層為可見
MoveLayer('AdLayer');//調用函數MoveLayer()
}
function MoveLayer(layerName) {
var x = 0;//浮動廣告層固定於瀏覽器的x方向位置
var y = 408;//浮動廣告層固定於瀏覽器的y方向位置
var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.90;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posright = x");//移動廣告層
setTimeout("MoveLayer('AdLayer');", 0);//設置20毫秒後再調用函數MoveLayer()
}
//-->
</script>
<div id=AdLayer style='position:absolute; width:61px; height:59px; z-index:20; visibility:hidden;; left: 0px; top: 100px'> <a href="#"><img border="0" src="images/jixiangwu.gif" width="81" height="88"></a></div>
『伍』 請問 網頁兩邊浮動廣告代碼div漂浮廣告代碼怎樣寫
左欄浮動廣告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: <script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; right: 1px; POSITION: absolute; TOP: 180px;'><TABLE cellSpacing=0 cellPadding=0 width=150 style='border-left:1px solid #2E6287;border-top:1px solid #2E6287;border-right:1px solid #2E6287;font-size:12px;color:#ffffff; border-bottom-color:#2E6287; border-bottom-width:1px'><TR bgcolor=#2E6287><TD height=20> 推薦↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>關 閉</TD></TR></TABLE><table border='1' width='150' height='500' bordercolor='#2E6287'><tr><td>廣告內容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;}window.setInterval("heartBeat0()",1);</script>
右欄浮動廣告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; left: 1px; POSITION: absolute; TOP: 50px;'><TABLE cellSpacing=0 cellPadding=0 width=360 style='border-left:1px solid #333333;border-top:1px solid #333333;border-right:1px solid #333333;font-size:12px;color:#ffffff'><TR bgcolor=#2E6287><TD height=20> 推薦↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>關 閉</TD></TR></TABLE><table border='1' width='150' id='table1' bordercolor='#2E6287' height='500'><tr><td>廣告內容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+perce
『陸』 求網站左右空白地方懸浮對聯廣告代碼,可以上下移動的那種
先在你的網站主目錄建立js文件,再建立一個JS文件(如ad-01.js)
打開文本將下面代碼復制到其中,保存格式為js
function initEcAd() {
document.all.AdLayer1.style.posTop = -200;
document.all.AdLayer1.style.visibility = 'visible'
document.all.AdLayer2.style.posTop = -200;
document.all.AdLayer2.style.visibility = 'visible'
MoveLeftLayer('AdLayer1');
MoveRightLayer('AdLayer2');
}
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// 左側廣告距離頁首高度
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 100;// 右側廣告距離頁首高度
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><a href='http://你鏈接的網址' target='_blank'><img src=你鏈接的圖片 border='0'></a></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><a href='http://你鏈接的網址' target='_blank'><img src=你鏈接的圖片 border='0'></a></div>");
initEcAd()
// JavaScript Document
還沒結束呢,,然後將 <script src="js/ad-01.js" language="JavaScript"></script>放在body中。就OK了,還不明白就加我QQ:9142673。我指導你。。