博客背景图片代码 sf090

来源:└博友窝  编辑:博客代码网  发布时间:2007-03-28  点击:  [收藏]

1、博客背景图片固定不滚动

<Body bgproperties="fixed">


2、随即显示图片,而每张图片会连接至不同的网址。将代码加入<body></body>之间。

<SCRIPT Language="JavaScript">
//随即图片加连接
pic01=new Array(); //图片路径(可用完整http的路径)
pic01[0]="hp_img/pki_title_01.gif";
pic01[1]="hp_img/pki_title_02.gif";
pic01[2]="hp_img/pki_title_03.gif";
pic01[3]="hp_img/pki_title_04.gif";

alt=new Array();//图片说明
alt[0]="蕃薯藤"; //对应pic01(0)图片的说明
alt[1]="YAHOO";
alt[2]="SINA";
alt[3]="104";

url=new Array();//连接网址
url[0]="http://www.yam.com.tw"; //请对应pic01[0]的图片及alt[0]的说明
url[1]="http://www.yahoo.com.tw";
url[2]="http://www.sina.com.tw";
url[3]="http://www.104.com.tw";

index = Math.floor(Math.random() * pic01.length);
document.write ("<a href="/ url[index] " target='_balnk'><img src=" pic01[index] " alt=" alt[index] " border=0></a>"); 
</SCRIPT>


3、鼠标指向图标时图片会变清晰,移开则变淡.

将代码一插入在<head></head>之间.

<STYLE>#spotlight {
FILTER: light
}

</STYLE>
<SCRIPT language=JavaScript1.2>

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=40
}


function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity =5
else if (window.highlighting)
clearInterval(highlighting)
}

</SCRIPT>


将代码二插入在<body></body>之间.其中注意更改链接网址和图片位置.

<a href="http://jxco.vip.sina.com"><img border=0 name=Image1 onMouseOut=low(this) onMouseOver=high(this)
src="../images/logo.gif" style="FILTER: alpha(opacity=40)" width=150 height="200"></a>


4、当鼠标移动到图片上时,回出现图片摇动的现象。

<img src=图片地址 class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this)">


5、图片纵向滚动连接(很适用友情连接)

<marquee id=snowscroll direction=up scrollDelay=100 scrollAmount=2 width=500 height=100 onMouseout=snowscroll.start() onMouseover=snowscroll.stop()>
<p align=center>
<a href="连接地址" target=_blank><img src="LOGO地址" width="88" height="31" border=0></a><br><br>
<a href="连接地址" target=_blank><img src="LOGO地址" width="88" height="31" border=0></a><br><br>
</marquee>

其中,width是显示出来的宽度,height是高度,可以根据需要调整。而scrollamount 和 scrolldelay 可以改变速度。direction是改变LOGO滚动的方向。



文章地址: