这种效果还比较酷的说,不过打开的时候有点慢(如果你打开的窗口很大的话)。

<script type="text/javascript">

function BgColor(){
    var x = 0, step = 1;
    while( x <= 0xffffff){
        document.bgColor = x;
        x += step;
        step <<= 8;
        if( step >= 0x1000000) step = 1;
    }
}

BgColor()
// ]]>
</script>

打开页面时背景色的渐变效果

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.