<html>
<head>
<style>
<!--
.intro{
position:absolute;
left:0;
top:0;
layer-background-color:#BDE6FE;
background-color:#0aa073; <!-- 점점 작아지는 색-->
border:0.1px solid #BDE6FE
}
-->
</style>
</head>
<BODY BGCOLOR="#FFFFFF">
♡이 부분에 넣고싶은 내용을 넣으세요 ♡
<div id="i1" class="intro"></div>
<script language="JavaScript1.2">
//change speed here
var speed=5
if (document.layers){
var reference=window.innerWidth/window.innerHeight
var temp=eval("document.i1.clip")
temp.left=temp.top=0
temp.right=window.innerWidth
temp.bottom=window.innerHeight
}
else if (document.all){
var reference=document.body.clientWidth/document.body.clientHeight
var rightclip,leftclip,topclip,bottomclip
var temp=document.all.i1.style
topclip=leftclip=0
rightclip=temp.width=document.body.clientWidth
bottomclip=temp.height=document.body.clientHeight
}
function doit(){
window.scrollTo(0,0)
if (document.layers){
if (temp.left>window.innerWidth/2)
clearInterval(stopit)
temp.left+=reference*speed
temp.top+=speed
temp.right-=reference*speed
temp.bottom-=speed
}
else if (document.all){
if (leftclip>document.body.clientWidth/2)
clearInterval(stopit)
temp.clip="rect( "+topclip+" "+rightclip+" "+bottomclip+" "+leftclip+")"
leftclip+=reference*speed
topclip+=speed
rightclip-=reference*speed
bottomclip-=speed
}
}
stopit=setInterval("doit()",100)
</script>
<style type="text/css">
#s0, #s1, #s2, #s3, #s4, #s5, #s6, #s7, #s8, #s9 {position:absolute; left:-10; top:-10; height:1; width:1}
</style>
<script language="JavaScript1.2">
<!--
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && self.innerWidth && (window.pageXOffset>-1));
//my way of making sure the browser will have what I need
var allDivs = new Array(10);
var documentWidth,documentHeight;
function initAll(){
if(!ns && !ie && !w3) return;
for(dNum=0; dNum<10; ++dNum){
if(ie) allDivs[dNum]=eval('document.all.s'+dNum+'.style');
else if(ns) allDivs[dNum]=eval('document.layers["s'+dNum+'"]');
else if(w3) allDivs[dNum]=eval('document.getElementById("s'+dNum+'").style');
moveTo(dNum,0,0);
}
}
function moveTo(i,tempx,tempy){
if (ie){
documentWidth =document.body.offsetWidth+document.body.scrollLeft-20;
randomy=Math.floor(Math.random()*document.body.offsetHeight)+document.body.scrollTop-20;
}
else if (ns){
documentWidth=window.innerWidth+window.pageXOffset-20;
randomy=Math.floor(Math.random()*window.innerHeight)+window.pageYOffset-20;
}
else if (w3){
documentWidth=self.innerWidth+window.pageXOffset-20;
randomy=Math.floor(Math.random()*self.innerHeight)+window.pageYOffset-20;
}
if(tempx>-50){
tempx-=45;
allDivs[i].left=tempx;
allDivs[i].top =tempy;
setTimeout("moveTo("+i+","+tempx+","+tempy+")",40)
}
else
setTimeout("moveTo("+i+",documentWidth-10,randomy)",2000/i+40);
}
window.onload=initAll
//End-->
</script>
<div id="s0" style="color:red">*</div>
<div id="s1" style="color:navy">*</div>
<div id="s2" style="color:red">*</div>
<div id="s3" style="color:maroon">*</div>
<div id="s4" style="color:red">*</div>
<div id="s5" style="color:gold">*</div>
<div id="s6" style="color:red">*</div>
<div id="s7" style="color:red">*</div>
<div id="s8" style="color:blue">*</div>
<div id="s9" style="color:red">*</div>
<!-- 옆에서 날라오는 별 색깔모양은 여기를 수정하세요 -->
</body>
</html>
'Javascript' 카테고리의 다른 글
달력및 시간 (0) | 2016.06.01 |
---|---|
사선으로 열리는 화면 (0) | 2016.06.01 |
반짝이며 올라가는 별 (0) | 2016.06.01 |
상태바에 별이 반짝여요. (0) | 2016.06.01 |
링크된 이미지들은 깜박 (0) | 2016.06.01 |