화면에 꽃들이 돌아다니는 스크립트 효과입니다
<script language="javascript">
var chk_shadowz=0
if(document.all['shadowz1'])chk_shadowz=1
if(chk_shadowz==0 && document.all){
document.write('<div id="shadowz1" style="position:absolute; left:83px; top:85px; width:39px; height:47px; z-index:7; border-width:1px; border-style:none;"><img src="flower3.gif"></div>')
document.write('<div id="shadowz2" style="position:absolute; left:84px; top:89px; width:36px; height:38px; z-index:8; border-width:1px; border-style:none;"><img src="flower5.gif"></div>')
document.write('<div id="shadowz3" style="position:absolute; left:78px; top:79px; width:48px; height:52px; z-index:9; border-width:1px; border-style:none;"><img src="flower6.gif"></div>')
document.write('<div id="shadowz4" style="position:absolute; left:79px; top:81px; width:48px; height:52px; z-index:10; border-width:1px; border-style:none;"><img src="flower7.gif"></div>')
for(i=1;i<5;i++){
document.all['shadowz' + i ].style.posLeft = (document.body.clientWidth-50)/2
document.all['shadowz' + i ].style.posTop = (document.body.clientHeight-50)/2
}
}
var a=2
var b=1.5
var c=-1
var d=-1
var e=3
var f=-2
var g=-2.5
var h=2
function gogogo(){
document.all['shadowz1'].style.posLeft += a
document.all['shadowz1'].style.posTop += b
document.all['shadowz2'].style.posLeft += c
document.all['shadowz2'].style.posTop += d
document.all['shadowz3'].style.posLeft += e
document.all['shadowz3'].style.posTop += f
document.all['shadowz4'].style.posLeft += g
document.all['shadowz4'].style.posTop += h
if(document.all['shadowz1'].style.posLeft <= 0)a= a * -1
if(document.all['shadowz1'].style.posLeft >= document.body.clientWidth - 50)a= a * -1
if(document.all['shadowz1'].style.posTop <= 0)b= b * -1
if(document.all['shadowz1'].style.posTop >= document.body.clientHeight + document.body.scrollTop - 50 )b= b * -1
if(document.all['shadowz2'].style.posLeft <= 0)c= c * -1
if(document.all['shadowz2'].style.posLeft >= document.body.clientWidth - 40)c= c * -1
if(document.all['shadowz2'].style.posTop <= 0)d= d * -1
if(document.all['shadowz2'].style.posTop >= document.body.clientHeight + document.body.scrollTop - 40 )d= d * -1
if(document.all['shadowz3'].style.posLeft <= 0)e= e * -1
if(document.all['shadowz3'].style.posLeft >= document.body.clientWidth - 55)e= e * -1
if(document.all['shadowz3'].style.posTop <= 0)f= f * -1
if(document.all['shadowz3'].style.posTop >= document.body.clientHeight + document.body.scrollTop - 55 )f= f * -1
if(document.all['shadowz4'].style.posLeft <= 0)g= g * -1
if(document.all['shadowz4'].style.posLeft >= document.body.clientWidth - 55)g= g * -1
if(document.all['shadowz4'].style.posTop <= 0)h= h * -1
if(document.all['shadowz4'].style.posTop >= document.body.clientHeight + document.body.scrollTop - 55 )h= h * -1
setTimeout('gogogo()',10)
}
if(document.all && chk_shadowz==0)gogogo()
if(document.all)document.onkeypress=kts
function kts(){
if(document.all && event.keyCode==96)alert('shadowz')
}
//
</script>