Click Here

相信能,才能
  首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

变化的logo

Posted on 2006-09-08 17:17  鬼手  阅读(272)  评论(0)    收藏  举报

每次加载页面,随机显示logo图像,比如我Blog的图像。
在博客园的管理里面选择选项Options » Configure
1.子标题中加入

<script>showmybg();</script>
2.通过CSS定制页面中加入
#top
{
    background-color
: #20375f;
    background-image
: url( "logo图片地址" );
    background-position
: left;
background-repeat
: no-repeat;
    height
: 90px;
    vertical-align
: middle;
}
3.页首Html代码中加入
<SCRIPT type=text/javascript> 
function showmybg()
{
bg 
= new Array(5); 
bg[
0= '图片地址0';
bg[
1= '图片地址1';
bg[
2= '图片地址2';
bg[
3= '图片地址3';
bg[
4= '图片地址4';
bg[
5= '图片地址5';
bg1
=new Array(5);
//配套背景色
bg1[0= '#20375f';
bg1[
1= '#388EAF';
bg1[
2= '#976B51';
bg1[
3= '#205F4B';
bg1[
4= '#604C95';
bg1[
5= '#797D6A';
//随机显示
index = Math.floor(Math.random() * bg.length); 
document.getElementById(
"top").style.backgroundImage='url("'+bg[index]+'")';
document.getElementById(
"top").style.backgroundColor=bg1[index];
}
</SCRIPT>