Menu

 

 

<html>
<head>
<title>마우스 주위를 맴도는 이미지</title>
<link rel="stylesheet" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">

<!-- Logo Orbit II kurt.grigg@virgin.net

yourLogo='안녕하세요?삶의향기에 잘 오셨습니다.방가워요. ';

logoFont='Arial';

logoSize=2;

logoColor='green';

logoWidth=80;

logoHeight=80;

logoSpeed=0.03;

//Nothing needs altering below!

yourLogo=yourLogo.split('');

L=yourLogo.length;

Result="<font face="+logoFont+" size="+logoSize+" color="+logoColor+">";

TrigSplit=360/L;

br=(document.layers)?1:0;

if (br){

for (i=0; i < L; i++)

document.write('<layer name="ns'+i+'" top=0 left=0 width=14 height=14">'+Result+yourLogo[i]+'</font></layer>');

}

else{

document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

for (i=0; i < L; i++)

document.write('<div id="ie" style="position:absolute;top:0px;left:0px;width:14px;height:14px">'+Result+yourLogo[i]+'</font></div>');

document.write('</div></div>');

}

ypos=0;

xpos=0;

step=logoSpeed;

currStep=0;

Y=new Array();

X=new Array();

Yn=new Array();

Xn=new Array();

for (i=0; i < L; i++)

{

Yn[i]=0;

Xn[i]=0;

}

(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt){

ypos = (document.layers)?evnt.pageY:event.y;

xpos = (document.layers)?evnt.pageX:event.x;

}

(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

function animateLogo(){

if (!br)outer.style.pixelTop=document.body.scrollTop;

for (i=0; i < L; i++){

var layer=(document.layers)?document.layers['ns'+i]:ie[i].style;

layer.top =Y[i]+logoHeight*Math.sin(currStep+i*TrigSplit*Math.PI/180);

layer.left=X[i]+logoWidth*Math.cos(currStep+i*TrigSplit*Math.PI/180);

}

currStep-=step;

}

function Delay(){

for (i=L; i >= 0; i--)

{

Y[i]=Yn[i]+=(ypos-Yn[i])*(0.1+i/L);

X[i]=Xn[i]+=(xpos-Xn[i])*(0.1+i/L);

}

animateLogo();

setTimeout('Delay()',20);

}

window.onload=Delay;

// -->

</script>
 
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><center>
<p>&nbsp;<img src="script/imge/w3.jpg" width="305" height="400" border="0"></p>
</center></td>
  </tr>
</table><p align="center">
 <input type=button name=bt_s value="소스보기" onClick='window.location="view-source:"+window.location.href'>
</body>
</html>

'Javascript' 카테고리의 다른 글

새창 띄우는 방법  (0) 2016.06.01
이미지를 눌러 보세요.전체배경으로  (0) 2016.06.01
이미지를 마우스로 움직여보세요.  (0) 2016.06.01
이미지가 왔다갔다..  (0) 2016.06.01
정가운데 새창 띄우기  (0) 2016.06.01