
-----------------------------------------------------------------------
<script language="javascript" type="text/javascript" src="http://www.javarush.com/common/js/prototype.js"></script>
<script language="javascript" type="text/javascript" src="http://www.javarush.com/common/js/scriptaculous.js"></script>
<div style="margin-top: 20px; height: 580px;">
<div id="photoPanel1" style="position: absolute; "><img src="http://www.javarush.com/images/img1.jpg" /></div>
<div id="photoPanel2" style="position: absolute; display: none; "><img src="http://www.javarush.com/images/img2.jpg" /></div>
<div id="photoPanel3" style="position: absolute; display: none; "><img src="http://www.javarush.com/images/img3.jpg" /></div>
<div style="position: absolute; margin-top: 450px;">
<table border="0" cellpadding="10" cellspacing="5" >
<tr>
<td style="background-color: red; width: 70px; height: 7px; cursor: hand;" onmouseover="changeMainImage('photopanel1');"></td>
<td style="background-color: green; width: 70px; height: 7px; cursor: hand;" onmouseover="changeMainImage('photopanel2');"></td>
<td style="background-color: blue; width: 70px; height: 7px; cursor: hand;" onmouseover="changeMainImage('photopanel3');"></td>
</tr>
</table>
</div>
</div>
<script language="javascript" type="text/javascript">
<!--
var choicePanel = document.getElementById('photopanel1');
function changeMainImage(arg1){
var obj = document.getElementById(arg1);
if(obj){
if(obj.id != choicePanel.id){
new Effect.Fade(choicePanel, { duration : 0.8 , afterFinishInternal : function() {
new Effect.Appear(obj, { duration : 0.8 } )
}
} );
}
choicePanel = obj;
}
}
var cnt = 1;
function autoChange(){
changeMainImage('photopanel' + cnt);
setTimeout("autoChange()", 5000);
cnt++;
if(cnt >= 4){
cnt = 1;
}
}
autoChange();
//-->
</script>
'DHTML > Javascript' 카테고리의 다른 글
ext-prototype-adapter 을 이용하여 prototype, Scriptaculous 사용하기 (0) | 2007.04.04 |
---|---|
새로산 책 ==> Ajax prototype.js: 프로토타입 완전분석 (0) | 2007.04.03 |
[javascript]URL Encoding/Decoding (0) | 2006.10.31 |
http://www.json.org/ (0) | 2006.08.14 |
javascript Logger (0) | 2006.05.25 |