語法展示:: http://home.graffiti.net/sddfgdgs223456/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script language="JavaScript">
<!--
var flyingwin
var popupwidth=500
var popupheight=200
var marginright
var windowcenter
var i_top=200
var i_left=-popupwidth-50
var step=40
var timer
var waitingtime=3000
var pause=20
function showWindow() {
flyingwin = window.open("", "flyingwin", "toolbar=no,width="+popupwidth+",height="+popupheight+",top=100,left="+(-popupwidth)+"");
flyingwin.document.open();
flyingwin.document.write('<html>\n<head>\n<title>漂浮視窗<\/title>\n<meta http-equiv="Content-Type" content="text/html; charset=big5">\n<\/head>\n<body bgcolor="#FFEAD5" text="#804000">\n<center>我在這裡我在這裡!<br>看到了沒......^_^\n<\/center>\n<\/body>\n<\/html>');
flyingwin.document.close();
if (document.all) {
marginright = screen.width+50
}
if (document.layers) {
marginright = screen.width+50
}
windowcenter=Math.floor(marginright/2)-Math.floor(popupwidth/2)
movewindow()
}
function movewindow() {
if (i_left<=windowcenter) {
flyingwin.moveTo(i_left,i_top)
i_left+=step
timer= setTimeout("movewindow()",pause)
}
else {
clearTimeout(timer)
timer= setTimeout("movewindow2()",waitingtime)
}
}
function movewindow2() {
if (i_left<=marginright) {
flyingwin.moveTo(i_left,i_top)
i_left+=step
timer= setTimeout("movewindow2()",pause)
}
else {
clearTimeout(timer)
flyingwin.close()
}
}
-->
</script>在 var popupwidth=500 中修改漂浮視窗的寬度 在 var popupheight=200 中修改漂浮視窗的高度 在 var waitingtime=3000 中修改漂浮視窗停留時間(每1秒=1000) 在 flyingwin.document.write("<html>......</html>"); 中修改漂浮視窗內部語法,但切記不可斷行
將下列語法貼於<body>之中
onload=showWindow()
留言列表