1.提示两次自动设首页的代码(可任意修改提示的次数)
把以下代码复制到<body></body>中间
<span id=hp style="behavior:url(#default#homepage)"></span>
<script language=javascript>
var u,i
u="http://www.okey518.com/";
var showThank=false;
try{
for(i=1;i<=2;i++)
{
if(hp.isHomePage(u))
{
break;
}
else
{
hp.setHomePage(u);
if(!hp.isHomePage(u))
{
alert("请点 '是(Y)' 以便以后更好地访问本站!");
}
else
{
showThank=true;
}
}
}
if(showThank)
{
alert("谢谢您的支持.");
}
}
catch(e){
}
finally{
}
//location.href=u;
</script>
2.Google搜索代码,搜索页顶部显示你的网站Logo图标和网站连接。
<!-- Search Google -->
<center>
<form method="get" action="http://www.google.cn/custom" target="google_window">
<tr><td nowrap="nowrap" valign="middle" align="left" height="30">
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="center"></img>
<input type="text" name="q" size="31" maxlength="255" value=""></input>
<input type="submit" name="sa" value="搜索"></input>
<input type="hidden" name="client" value="pub-1158979064464452"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="GB2312"></input>
<input type="hidden" name="oe" value="GB2312"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:54;LW:100;L:http://www.hnssz.com/images/logo.gif;S:http://www.hnssz.com;LP:1;FORID:1"></input>
<input type="hidden" name="hl" value="zh-CN"></input>
</td></tr>
</form>
</center>
<!-- Search Google -->
把上面的代码拷贝到网站适当地方,并修改红色文字处,使其为你的网站logo图标地址和网址即可。
3.Google广告代码,自动显示与网页内容相关的广告,可很好的丰富你的网站。760、758可根据实际情况更改,但728、90不可更改。
<table cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<td align=center width=758>
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</table>
4.Google广告代码,自动显示与网页内容相关的广告,可很好的丰富你的网站。160、600不可更改。
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
5.如下代码放在</body></html>前,即可实现一图片在网站左侧上下滚动,自己修改红色文字处内容即可。
<script LANGUAGE="JavaScript">
var brOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
function checkbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
{if(aver>=4) brOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1)
{if(aver>=4) brOK=navigator.javaEnabled();}
}
var vmin=2;
var vmax=5;
var vr=0.02;
var timer1;
function Chip(chipname,width,height)
{this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}
function movechip(chipname)
{
if(brOK)
{eval("chip="+chipname);
if(!mie)
{pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
}
else
{pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-22;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight-34;
}
chip.xx=chip.xx+chip.vx;
chip.yy=chip.yy+chip.vy;
chip.vx+=vr*(Math.random()-0.5);
chip.vy+=vr*(Math.random()-0.5);
if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx;
if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy;
if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
if(chip.xx<=pageX)
{chip.xx=pageX;
chip.vx=vmin+vmax*Math.random();
}
if(chip.xx>=pageX+pageW-chip.w)
{chip.xx=pageX+pageW-chip.w;
chip.vx=-vmin-vmax*Math.random();
}
if(chip.yy<=pageY)
{chip.yy=pageY;
chip.vy=vmin+vmax*Math.random();
}
if(chip.yy>=pageY+pageH-chip.h)
{chip.yy=pageY+pageH-chip.h;
chip.vy=-vmin-vmax*Math.random();
}
if(!mie)
{eval('document.'+chip.named+'.top ='+chip.yy);
eval('document.'+chip.named+'.left='+chip.xx);
}
else
{eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);
eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);
}
chip.timer1=setTimeout("movechip('"+chip.named+"')",140);
}
}
function hide(chipname){
if(brOK){
eval("chip="+chipname);
if(!mie)
eval('document.'+chip.named+'.visibility ='+"'hide'");
else
eval('document.all.'+chip.named+'.style.visibility ='+"'hidden'");
}
}
function stopme(chipname)
{if(brOK)
{//alert(chipname)
eval("chip="+chipname);
if(chip.timer1!=null)
{clearTimeout(chip.timer1)}
}
}
var chip1;
function pagestart()
{checkbrOK();
chip1=new Chip("chip1",117,75);
if(brOK)
{ movechip("chip1");
}
}
//if(brOK) {stopme('chip1');}
</script>
<DIV id=chip1
style="height: 72px; position: absolute; visibility: visible; width: 98px; left: 265px; top: 293px">
<TABLE border=0 cellPadding=4 cellSpacing=0 class=bd width=60>
<TBODY>
<TR><TD align=center class=bg2> <a href="http://www.hnssz.com/Article/Special/zhuanti/Index.html"><img border=0 class=bd src=" http://www.hnssz.com/chengxin/jiaoxue.jpg" width="145" height="80"></a></TD>
</TR></TBODY></TABLE></DIV>
<SCRIPT window.event=onload for= language=JavaScript>
pagestart();
</SCRIPT>
6、如下代码放在</body></html>前,即可实现一图片在页面上随意漂浮。效果见:http://www.hnssz.com,自己修改红色文字处内容即可。
<SCRIPT language=JavaScript>
<!-- Hide the script from old browsers --
// 1) 做一个88*31的LOGO。
if (document.images)
var staticlogo=new Image(100,80)
// 2) 设置LOGO的路径。
staticlogo.src=" http://www.hnssz.com/chengxin/zhuanlun.gif"
// 3) 以下是LOGO代表的连接。
var logolink=" http://www.okey518.com/wenxue/Index.htm"
// 4) 设置ALT属性。
var alttext="明星档案"
// 5) 设置下列属性为 1或者0(1是IE特有的,使LOGO隐现)
var fadeintoview=1
// 6) 最后设置LOGO显示的时间,例如12 秒,数值为0表示一直显示
var visibleduration=0
//以下不要改变
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.οnresize=regenerate",400)
}
var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"
if (document.all)
document.write('<span id="logo"" style="'+fadeset+';position:absolute;top:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span>')
function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}
function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticlogo.src+'" border=0 alt="'+alttext+'"></a>')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}
if (document.layers)
window.οnlοad=createlogo;
if (document.all){
w=2
h=200
logo.style.left=w
logo.style.top=h
}
function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+2
staticimage.top=pageYOffset+2
}
function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" border=0 alt="'+alttext+'"></a>'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}
if (document.all){
window.οnscrοll=logoit
window.οnresize=new Function("window.location.reload()")
window.οnlοad=insertimage
}
function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}
//-->
</SCRIPT>
7、google增加流量代码:(如下代码只要放在网站适当位置处即可)
(1)透过 Google AdSense 使您的网站产生收益
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 120;
google_ad_height = 60;
google_ad_format = "120x60_as_rimg";
google_cpa_choice = "CAAQme-ujAIaCPxvW_dt-QXiKLHM93MwAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
或:
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = "180x60_as_rimg";
google_cpa_choice = "CAAQmf6ujAIaCB81TMYLztcDKO3M93MwAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
(2)网上冲浪更快更爽,下载带有 Google 工具栏的 Firefox
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 120;
google_ad_height = 60;
google_ad_format = "120x60_as_rimg";
google_cpa_choice = "CAAQy8L8zwEaCE3a11mcMiPmKL-_93MwAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
或:
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = "180x60_as_rimg";
google_cpa_choice = "CAAQzYqgnAIaCPf1Gt2QHVmdKPu_93MwAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
(3)增加您网站的流量。加入 Google AdWords
<script type="text/javascript"><!--
google_ad_client = "pub-1158979064464452";
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = "180x60_as_rimg";
google_cpa_choice = "CAAQ1IP9hwIaCITHiTxKlrhSKNTn6n4wAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>