잊지 않겠습니다.

회사에서 디자이너분이 필요하다고 해서 예제 간단히 뚝딱뚝딱.

<html>
<head>
<script src="jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" language="javascript">
$(function(){
$('#clickMe1').click(function(){
$('#info').load('load.html #movie', function() {
$(this).hide().appendTo('context').slideDown();
});
$(this).attr("src", 'images\\00buy_05.gif');
$('#clickMe2').attr("src", "images\\00buy_19.gif");
});
$('#clickMe2').click(function() {
$('#info').load('load.html #music', function() {
$(this).hide().appendTo('context').slideDown();
});
$(this).attr("src", 'images\\00buy_21.gif');
$('#clickMe1').attr("src", "images\\00buy_03.gif");
});
$('#clickMe3').click(function(){
$('#info').load('load.html #poem', function() {
$(this).hide().appendTo('context').slideDown();
});
$(this).html("Changed Text");
});
});
</script>
<script type="text/javascript" language="javascript">
function show_alert(){
alert('show');
}
</script>
</head>

<body>
<img id="clickMe1" src="images\00buy_03.gif" onclick="javascript:show_alert();"/>
<img id="clickMe2" src="images\00buy_19.gif"/>
<a href="#" id="clickMe3">Click Me3</a>
<div id="info">
<div id="context">
</div>
</div>
</body>
</html>

재미있기도 하고, 너무나 동작하는 것이 신기한 jquery. ^^
Posted by Y2K
,