웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
앗!! 내별!! 내별날라가네
2006.10.14 12:38
아래 소스를 <head>와 </head>사이에 넣으세요.
<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>
아래 소스를 <BODY>와 </body>사이에 넣으세요.
그림을 넣고 싶으실 때는 <div id="s0"><img src="그림 주소"></div>와 같이 태그를 써주세요.
<div id="s0" style="color:blue">☆</div>
<div id="s1" style="color:blue">★</div>
<div id="s2" style="color:blue">☆</div>
<div id="s3" style="color:blue">★</div>
<div id="s4" style="color:blue">☆</div>
<div id="s5" style="color:blue">★</div>
<div id="s6" style="color:blue">☆</div>
<div id="s7" style="color:blue">★</div>
<div id="s8" style="color:blue">☆</div>
<div id="s9" style="color:blue">★</div>
옆으로 날라간다;;;;;;
<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>
아래 소스를 <BODY>와 </body>사이에 넣으세요.
그림을 넣고 싶으실 때는 <div id="s0"><img src="그림 주소"></div>와 같이 태그를 써주세요.
<div id="s0" style="color:blue">☆</div>
<div id="s1" style="color:blue">★</div>
<div id="s2" style="color:blue">☆</div>
<div id="s3" style="color:blue">★</div>
<div id="s4" style="color:blue">☆</div>
<div id="s5" style="color:blue">★</div>
<div id="s6" style="color:blue">☆</div>
<div id="s7" style="color:blue">★</div>
<div id="s8" style="color:blue">☆</div>
<div id="s9" style="color:blue">★</div>
옆으로 날라간다;;;;;;
댓글 3
제목 | 글쓴이 | 날짜 |
---|---|---|
배경 음악 연주기(다기능/스틱형) [1] | 이민주 | 2006.10.09 |
{로그인}관리자 로그인 폼 간단함 [2] | 김민환 | 2006.10.10 |
일반 시간...... [1] | 김민환 | 2006.10.10 |
위의 메뉴에 마우스를 올리면 밑에 메뉴가 나오는 소스 [1] | 김민환 | 2006.10.10 |
당신은~째 방문자 이십니다.<카운터> [11] | 김민환 | 2006.10.10 |
즐겨찾기 추가방법 [2] | 김민환 | 2006.10.10 |
앗 불꽃놀이다 구경가자 [3] | 김민환 | 2006.10.14 |
졸리시면 이것을 한번 써보세요.......(큰창 필수!!)지진이다 [2] | 김민환 | 2006.10.14 |
홈페이지의 필수!! 뮤직 플레이어!! [3] | 김민환 | 2006.10.14 |
앗!! 내별!! 내별날라가네 [3] | 김민환 | 2006.10.14 |
고글검색하기!! [7] | 김민환 | 2006.10.30 |
셀렉트 박스를 이용한 콘트롤 만들기 ( 위로 이동 ) [1] | 예뜨락 | 2006.10.30 |
셀렉트 박스를 이용한 콘트롤 만들기 ( 아래로 이동 ) | 예뜨락 | 2006.10.30 |
context menu - 마리홈 이름 팝업 레이어 [3] | 예뜨락 | 2006.10.30 |
도트 이모티콘 생성기 [21] | 예뜨락 | 2006.10.30 |
로딩 레이어 만들기 [6] | 이진수 | 2006.11.27 |
처음 만들어본 자바 스크립트.. 나이 알아 맞추기 [2] | 김동헌 | 2006.12.05 |
[동영상강좌] 홈페이지에 BGM을 달아보자 [5] | 서기 | 2007.01.10 |
슬라이딩 레이어 메뉴!! 메뉴가 상하로 따라다녀요!! [4] | TiZa | 2007.02.03 |
간단한 덧셈 뺄셈 계산 | 예뜨락 | 2007.02.14 |