 |
|
|  |
jQuery ¾Ö´Ï¸ÞÀÌÆ®·Î ¸¸µé¾îº¸´Â À̹ÌÁö ½½¶óÀÌ´õ¿Í Àü±¤ÆÇ |
|
|
 |
14³â Àü |
ÀÚ¹Ù½ºÅ©¸³Æ® ÇÁ·¹ÀÓ¿öÅ© ¶óÀ̺귯¸® jQueryÀÇ ¾Ö´Ï¸ÞÀÌ¼Ç °ü·Ã ¸Þ¼Òµå¸¦ ÀÌ¿ëÇؼ ÇнÀ¿ë À̹ÌÁö ½½¶óÀÌ´õ¿Í Àü±¤ÆÇÀ» ¸¸µé¾î ºÃ½À´Ï´Ù. jQueryÀÇ "animate()"¶ó´Â ¸Þ¼Òµå·Î °³º° ¿¤¸®¸ÕÆ®¿¡ ¸ð¼Ç ÀÌÆåÆ®¸¦ ºÎ¿©ÇÒ ¼ö ÀÖÀ¸¸ç ÀÚ¹Ù½ºÅ©¸³Æ® ¸Þ¼ÒµåÀÎ "setInterval()" ¸¦ ÀÌ¿ëÇؼ ²÷ÀÓ¾øÀÌ ¹Ýº¹µÇ´Â ¾Ö´Ï¸ÞÀ̼ÇÀ» ¸¸µé ¼ö ÀÖ½À´Ï´Ù. jQuery ÀÇ "hover()" À̺¥Æ® Çڵ鷯¿Í ÀÚ¹Ù½ºÅ©¸³Æ® "clearInterval()" ¸Þ¼Òµå¸¦ È°¿ëÇؼ Àá½Ã ¸ØÃã È¿°ú¸¦ ¸¸µé ¼ö ÀÖÁö¿ä. Ãß°¡·Î "jQuery Easing v1.3"À» È°¿ëÇؼ ´Ù¾çÇÑ ÀÌÆåÆ® ¿É¼ÇÀ» Å×½ºÆ® ÇÒ ¼ö ÀÖµµ·Ï Çß½À´Ï´Ù. Çϴܺο¡ ÀÖ´Â ¿É¼Ç¸íÀ» Ŭ¸¯ÇÏ¸é °³º° ÀÌÆåÆ®¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
[Àü±¤ÆÇ°ú À̹ÌÁö ½½¶óÀÌ´õ ½ÇÇà ȸé]
http://www.hompydesign.com/javascript/animate/
[Àü±¤ÆÇ°ú À̹ÌÁö ½½¶óÀÌ´õ ¼Ò½º ÄÚµå]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Animate</title>
<link type="text/css" href="/ui/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.easing.1.3.js"></script>
<style type="text/css">
body {font-size: 12px; font-family:"Dotum", "Tahoma";}
img {border:0px;}
a:link {color:#3366CC; text-decoration:none;}
a:active {color:#FF9966; text-decoration:none;}
a:visited {color:#3366CC; text-decoration:none;}
a:hover {color:#FF9966; text-decoration:underline;}
.body {width:440px; height:280px; border:1px solid #CCCCCC; padding:10px; background-color:#FAFDE2}
#navi_tool {position:relative; width:400px; height:16px; overflow:hidden;}
#navi {position:absolute; left:0px; top:0px;}
#navi div {height:20px;}
#album_tool {position:relative; width:380px; height:120px; overflow:hidden;}
#album {position:absolute; width:2000px; left:0px; top:0px;}
#album div {float:left; margin:0px; padding:0px;}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#navi").attr("motion", "easeInOutSine");
$("#album").attr("motion", "easeInOutExpo")
$("#navi").attr("top", "0");
$("#album").attr("top", "0")
$("#navi").attr("height", $("#navi>div").eq(0).height());
$("#album").attr("width", $("#album>div").eq(0).width());
$("#navi").attr("total", $("#navi>div").size());
$("#navi>div").eq(0).clone().appendTo($("#navi"));
$("#navi").hover(function(){
clearInterval($("#navi").attr("timer"));
},function(){
$("#navi").attr("timer", setInterval(my_rotate, 3000));
my_rotate();
});
$("#navi").attr("timer", setInterval(my_rotate, 3000));
$("#album").attr("total", $("#album>div").size());
$("#album>div").eq(0).clone().appendTo($("#album"));
$("#album>div").eq(1).clone().appendTo($("#album"));
$("#album").hover(function(){
clearInterval($("#album").attr("timer"));
},function(){
$("#album").attr("timer", setInterval(my_album, 3000));
my_album();
});
$("#album").attr("timer", setInterval(my_album, 3000));
$("#motion_tool>a").click(function(){
$("#navi").attr("motion", $(this).text());
$("#album").attr("motion", $(this).text())
});
});
function my_rotate(){
if ($("#navi:animated").size()) return false;
var height = $("#navi").attr("height");
var pos = (parseInt($("#navi").attr("top"))+1);
var px = pos * height;
$("#navi").attr("top", pos);
$("#navi").animate({
top: ((px * -1) + "px")
}, 1000, $("#navi").attr("motion"),
function() {
var pos = parseInt($("#navi").attr("top"));
var total = parseInt($("#navi").attr("total"));
if (pos>=total) {
$("#navi").attr("top", 0);
$("#navi").css("top", "0px");
}
}
);
}
function my_album(){
if ($("#album:animated").size()) return false;
var width = $("#album").attr("width");
var pos = (parseInt($("#album").attr("top"))+1);
var px = pos * width;
$("#album").attr("top", pos);
$("#album").animate({
left: ((px * -1) + "px")
}, 1000, $("#album").attr("motion"),
function() {
var pos = parseInt($("#album").attr("top"));
var total = parseInt($("#album").attr("total"));
if (pos>=total) {
$("#album").attr("top", 0);
$("#album").css("left", "0px");
}
}
);
}
</script>
</head>
<body>
<div class="body">
<div class="demo">
<div id="navi_tool">
<div id="navi">
<div><a href="http://hompy.info/574" target="_blank">1. jQuery ¾Ö´Ï¸ÞÀÌÆ®·Î ¸¸µé¾îº¸´Â À̹ÌÁö ½½¶óÀÌ´õ¿Í Àü±¤ÆÇ</a></div>
<div><a href="http://hompy.info/569" target="_blank">2. ½É½ÉÇ®ÀÌ¿ë Ç÷¡½Ã Ÿ¿ö µðÆ潺 °ÔÀÓµé°ú Ç÷¹ÀÌ µ¿¿µ»ó</a></div>
<div><a href="http://hompy.info/570" target="_blank">3. À߸¸µç Àαâ Ç÷¡½Ã °ÔÀÓ ¹öºíÅÊÅ©2¿Í ÁªÅ©·¡ÇÁÆ®</a></div>
<div><a href="http://hompy.info/571" target="_blank">4. Æ÷Åп¡¼ ¿î¿µÇϴ ä¿ëÁ¤º¸ °Ë»ö, Ãë¾÷ °Ë»ö, Ãë¾÷ ¼¾ÅÍ</a></div>
<div><a href="http://hompy.info/572" target="_blank">5. jQuery¸¦ È°¿ëÇÑ È¨ÆäÀÌÁö °³¹ßÀÇ ±âº»ÀÎ ÀÔ·ÂÆû Á¦ÀÛ</a></div>
</div>
</div>
<br />
<div id="album_tool">
<div id="album">
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=1' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=2' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=3' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=4' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=5' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=6' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=7' width=190></a></div>
<div><a href="http://hompy.info/24" target="_blank"><img src='http://www.hompydesign.com/hompydesign.com?no=8' width=190></a></div>
</div>
</div>
<br />
<div id="motion_tool">
<a href="#">easeInQuad</a>
<a href="#">easeOutQuad</a>
<a href="#">easeInOutQuad</a>
<a href="#">easeInCubic</a>
<a href="#">easeOutCubic</a>
<a href="#">easeInOutCubic</a>
<a href="#">easeInQuart</a>
<a href="#">easeOutQuart</a>
<a href="#">easeInOutQuart</a>
<a href="#">easeInQuint</a>
<a href="#">easeOutQuint</a>
<a href="#">easeInOutQuint</a>
<a href="#">easeInSine</a>
<a href="#">easeOutSine</a>
<a href="#">easeInOutSine</a>
<a href="#">easeInExpo</a>
<a href="#">easeOutExpo</a>
<a href="#">easeInOutExpo</a>
<a href="#">easeInCirc</a>
<a href="#">easeOutCirc</a>
<a href="#">easeInOutCirc</a>
<a href="#">easeInElastic</a>
<a href="#">easeOutElastic</a>
<a href="#">easeInOutElastic</a>
<a href="#">easeInBack</a>
<a href="#">easeOutBack</a>
<a href="#">easeInOutBack</a>
<a href="#">easeInBounce</a>
<a href="#">easeOutBounce</a>
<a href="#">easeInOutBounce</a>
</div>
</div>
</body>
</html>
|
|
̵̧ : 1027 |
̵̧
¸ñ·Ï
|
|
|  |
|