网页悬浮代码大全

更多文件请光临:http://jkcpw.taobao.com  

 

 

代码大全

自动弹出一个屏幕广告,并在几秒内自动消失-不代过渡效果!

 

<!-- 把下列代码加到<head>区域内 -->

<SCRIPT>

 

//more javascript from http://www.webjx.com

var val=1 ;

function wait()

{

       if(val==1)

       {

              //8000是停留的时间

              setTimeout("wait()",8000) ;

              val-- ;

       }

       else

       {

              image.style.display='none' ;

       }

}

 

</SCRIPT>

<table width="760" height="219" border="0" align="center" cellpadding="0" cellspacing="0"  bgcolor="#FFFFFF" id=image>

  <tr>

    <td width="760" height="219"><a href="#" target="_blank"><img src="http://10.116.42.15:85/showimg.asp?BoardID=13&filename=2010-9/201091713253626076.jpg" width="760" height="420" border="0"></a></td>

  </tr>

</table>

<!-- 修改<body>内容 -->

<body onLoad="wait();">

 

漂浮效果,就是在网页右边随上下滚动而滚动的效果。一般常用于TOP上!

 

 

<style>

body{

  position:relative;

  }

.fixed{

  right:20px;

  top:10px;

  position:fixed;

  +position:absolute;

  +top:eXPression(eval(document.body.scrollTop)+10);

  }

</style>

<div class="fixed"><img src=http://www.webjx.com/images/logo.gif></div>

<div style=height:1000px>x</div>

 

带关闭按钮的网页漂浮广告代码

<Html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>带关闭按钮的网页漂浮广告代码webjx.com</title>

</head>

<body>

<div id="img" style="position: absolute; left: 10; top: 10;visibility :hidden;" onmouseover="clearInterval(interval)"

 

onmouseout="interval = setInterval('changePos()', delay)" align="right">

<a href="#" target="_blank"><img border="0" src="http://www.webjx.com/img/200406301.jpg"></a><br><span

 

style="CURSOR:hand;color:red;font-weight:bold" onclick="clearInterval(interval);img.style.visibility = 'hidden'">X</span>

</div>

<script language=javascript>

var XPos = 20;//from webjx.com

var yPos = document.body.clientHeight;

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;                    

img.style.top = yPos;                   

function changePos() {                  

width = document.body.clientWidth;                   

height = document.body.clientHeight;                   

Hoffset = img.offsetHeight;                   

Woffset = img.offsetWidth;                  

img.style.left = xPos + document.body.scrollLeft;                   

img.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() {                   

img.style.visibility = "visible";                 

interval = setInterval('changePos()', delay);                   

}             

start(); 

</script>

</body>

</html>

网站新年祝福FLASH动画代码五秒自动消失广告代码

 

<SCRIPT LANGUAGE="JavaScript1.2">

adTime=5; //关闭窗口等待的时间

 

chanceAd=1;

var ns=(document.layers);

var ie=(document.all);

var w3=(document.getElementById && !ie);

adCount=0;

function initAd(){

        if(!ns && !ie && !w3) return;

        if(ie)                adDiv=eval('document.all.sponsorAdDiv.style');

        else if(ns)        adDiv=eval('document.layers["sponsorAdDiv"]');

        else if(w3)        adDiv=eval('document.getElementById("sponsorAdDiv").style');

        randAd=Math.ceil(Math.random()*chanceAd);

        if (ie||w3)

        adDiv.visibility="visible";

        else

        adDiv.visibility ="show";

        if(randAd==1) showAd();

}

function showAd(){

if(adCount<adTime*10){adCount+=1;

        if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;

        documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}

        else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;

        documentHeight=window.innerHeight/2+window.pageYOffset-20;}

        else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;

        documentHeight=self.innerHeight/2+window.pageYOffset-20;}

        adDiv.left=documentWidth-200;adDiv.top =documentHeight-200;

        setTimeout("showAd()",100);}else closeAd();

}

function closeAd(){

if (ie||w3)

adDiv.display="none";

else

adDiv.visibility ="hide";

}

onload=initAd;

</script>

<div id="sponsorAdDiv" style="visibility:hidden">

 

 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

 

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="960" height="110">

    <param name="movie" value="http://www.cnzz.cc/cn888/2010/2010.swf" />

    <param name="quality" value="high" />

    <embed src="http://www.cnzz.cc/cn888/2010/2010.swf" quality="high"

 

pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="960"

 

height="110"></embed>

  </object>

</div>

 

 

posted @ 2012-11-05 16:23  sungoody  阅读(1023)  评论(0编辑  收藏  举报