Image 연속 스크롤

작성자 정보

  • 작성자 관리자
  • 아이피 125.♡.51.2
  • 작성일

컨텐츠 정보

본문

▷ Image Change Banner [그림이 순환되며 바뀌는 배너]

Tag, Css, Script

<HTML>
<META   HTTP-EQUIVE="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=EUC-KR">
<head>
<title> 연습할 문서의   제목 
<script language="JavaScript">
<!--
var showw=300;
var showh=450;
var showbg='white';
var delay=1000;
var imgs=new Array();
imgs[0]='<img   src="1.jpg" border="0">';
imgs[1]='<img   src="2.jpg" border="0">';
imgs[2]='<img   src="3.jpg" border="0">';
 
if (imgs.length>1) i=2
else i=0;
 
function move1(whichlayer){
tlayer=eval(whichlayer);
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0;
setTimeout("move1(tlayer)",delay);
setTimeout("move2(document.main.document.second)",delay);
return;
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5;
setTimeout("move1(tlayer)",100);
}   else {
tlayer.top=showh;
tlayer.document.write(imgs[i]);
tlayer.document.close();
if (i==imgs.length-1)   i=0
else i++;
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer);
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0;
setTimeout("move2(tlayer2)",delay);
setTimeout("move1(document.main.document.first)",delay);
return;
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5;
setTimeout("move2(tlayer2)",100);
}   else {
tlayer2.top=showh;
tlayer2.document.write(imgs[i]);
tlayer2.document.close();
if (i==imgs.length-1)   i=0
else i++;
}
}
function move3(whichdiv){
tdiv=eval(whichdiv);
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0;
setTimeout("move3(tdiv)",delay);
setTimeout("move4(second2)",delay);
return;
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5;
setTimeout("move3(tdiv)",100);
}   else {
tdiv.style.pixelTop=showh;
tdiv.innerHTML=imgs[i];
if (i==imgs.length-1)   i=0
else i++;
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv);
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0;
setTimeout("move4(tdiv2)",delay);
setTimeout("move3(first2)",delay);
return;
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5;
setTimeout("move4(second2)",100);
}   else {
tdiv2.style.pixelTop=showh;
tdiv2.innerHTML=imgs[i];
if (i==imgs.length-1)   i=0
else i++;
}
}
function startit(){
if (document.all){
move3(first2);
second2.style.top=showh;
}   else if (document.layers){
document.main.visibility='show';
move1(document.main.document.first);
document.main.document.second.top=showh+5;
document.main.document.second.visibility='show';
}
}
//-->
</script>
<script language="JavaScript">
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+showw+
';height:'+showh+';overflow:hiden;background-color:'+showbg+'">');
document.writeln('<div style="position:absolute;width:'+showw+
';height:'+showh+';clip:rect(0 '+showw+' '+showh+' 0);left:0;top:0">');
document.writeln('<div id="first2" style="position:absolute;width:'+
showw+';left:0;top:1;">');
document.write(imgs[0]);
document.writeln('</div>');
document.writeln('<div id="second2" style="position:absolute;width:'+
showw+';left:0;top:'+showh+'">');
document.write(imgs[1]);
document.writeln('</div>');
document.writeln('</div>');
document.writeln('</span>');
}
</script>
<script language="JavaScript">
window.onload=startit;
</script>
</head>
<body   onload="slideit();">
<ilayer id="main"   width=&{showw}; height=&{showh}; bgColor=&{showbg}; visibility=hide>
<layer id="first"   left="50"   top="1" width=&{showw}; z-index="1">
<script language="JavaScript">
if (document.layers) document.write(imgs[0]);
</script>
</layer>
<layer id="second" left="50" top="0" width=&{showw}; z-index="1">
<script language="JavaScript">
if (document.layers) document.write(imgs[1]);
</script>
</layer>
</ilayer>
</body>
</HTML>

실행결과

관련자료

댓글 0
등록된 댓글이 없습니다.
Total 30 / 2 Page
번호
제목
이름