2006-11-21 06:42 PM SugAr*鈴__
小語法~

背景圖置中
<STYLE>
body{ background-image: url(圖片網址); background-repeat: no-repeat;
background-attachment: fixed; background-position: 50% 50% }</STYLE>

背景向下滑
<script language="VBScript">
dim i, pic
i = -1
pic = document.body.sourceIndex
sub scrollBG
i=i+1
Document.all(pic).style.BackgroundPosition= "0 " & i
id=SetTimeOut("scrollBG", 50, "VBScript")end sub
scrollBG</script>

背景斜移
<SCRIPT language="Javascript">
var background = "圖片網址";
var speed = 80;
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName != "Netscape" || browserVer >= 4.5) {
function moveback(movert,movedn,hPos,vPos) {
if (arguments[4])
document.body.style.backgroundImage = "url(\"" + arguments[4] + "\")";if (arguments[5])
document.body.style.backgroundRepeat = arguments[5]
if (!isNaN(hPos)) {
if ((movert!=0) && (hPos>0)) hPos=-100000
hPos += movert} if (!isNaN(vPos)) {
if ((movedn!=0) && (vPos>0)) vPos=-100000
vPos+= movedn}
document.body.style.backgroundPosition= hPos + " " + vPos
if (isNaN(hPos)) hPos = "\"" + hPos + "\""
if (isNaN(vPos)) vPos = "\"" + vPos + "\""
setTimeout("moveback("+movert+","+movedn+","+hPos+","+vPos+")",speed)
}moveback(1,1,0,0, background);}</SCRIPT>

背景圖淡化
<style>
body{
background-image : url(背景圖網址);filter:Alpha(Opacity=40);
background-repeat : repeat;
background-attachment : fixed;}
</style>


背景圖語法
<BODY bgcolor="cccccc" background="圖片網址" bgproperties="fixed">


背景顏色
<STYLE>
body{background-color:black}
</STYLE>

板面灰階
<style>
body{filter:gray}
</style>

板面淡化 做成半透明效果
<STYLE>
table{filter:Alpha(Opacity=60)}
</STYLE>

板面糢糊
<style>
body{filter:Blur(Direction=45,Strength=5)}
</style>

板面負片
<style>
body{Filter:Invert}
</style>

板面x光效果
<style>
body{Filter:Xray}
</style>

時間月曆 3
<style>
.shd {color:blue ;font:9pt Verdana;
background-color:#ccffff}
.shd0 {color:white ;font:9pt Verdana;
background-color:#66ffff }
.shd1 {color:white ;font:9pt Verdana;
background-color:#99ffff }
.shd6 {color:white ;font:9pt Verdana;
background-color:#1ffff3 }
.shd7 {background-color:white }
.shd2 { color:red ;font:9pt Verdana; }
.shd3 { color:orange ;font:9pt Verdana; }
.shd4 { color:#00FF00 ;font:9pt Verdana; }
</style>
<script language="JavaScript">
function greeting(){
var today = new Date();
var hrs = today.getHours();
document.writeln("<TABLE width=190 border=0 cellspacing=2 cellpadding=2 class=shd7>");
document.write("<tr><td COLSPAN=7 align=center class=shd6>各位好:");
if (hrs < 6)
document.write("(Early) Morning");
else if (hrs < 12)
document.write("早晨喇!");
else if (hrs <= 18)
document.write("午安喇!");
else
document.write("晚安喇!");
document.writeln("<tr><td COLSPAN=7 align=center class=shd0>");
dayStr = today.toLocaleString();
document.write(dayStr);
document.writeln("");}
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11){
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;}
function calendar(){
var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30,
31, 30, 31);
year = today.getYear();
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2)
firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<TR><TD class=shd><FONT class=shd3>日<TD class=shd>一<TD class=shd>二<TD class=shd>三<TD class=shd>四<TD class=shd>五<TD class=shd><FONT class=shd4>六");
document.write("<TR>");
column = 0;
for (i=0; i<startDay; i++){
document.write("<TD class=shd>");
column++;}
for (i=1; i<=nDays; i++){
document.write("<TD class=shd>");
if (i == thisDay)
document.write("<FONT class=shd2>")
document.write(i);
if (i == thisDay)
document.write("")
column++;
if (column == 7){
document.write("<TR>");
column = 0;}}
document.write("</TABLE>");
document.writeln("");}
greeting();
document.write("");
calendar();
document.write("");
</script>

小型地震
<script>
function shake(n) {
if (self.moveBy){
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}} } }shake(5);</script>

彩色可選歌之音樂盒
<bgsound id=bs><select onChange="bs.src=this.value" name="select" class="w" size="1"style="background-color:yellow; color: blue">
<option>選首你喜歡的音樂</option>
<option value="網址" style="background-color: skyblue; color: green">歌名
<option value="網址" style="background-color: skyblue; color: green">歌名</select>

[[i] 本帖最後由 小ice冰 於 2006-11-21 06:49 PM 編輯 [/i]]

頁: [1]
查看完整版本: 小語法~


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.