<head>
<title>Jqeury Animation</title>
<meta charset='utf-8'>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src='https://code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
<script src="jquery-animate-css-rotate-scale.js"></script>
<script type="text/javascript">
</script>
<style>
*{margin:0; padding: 0}
.box1{
position: relative;
background: lightyellow;
width:200px;
height:200px;
text-align: center;
}
.box1 h1{
line-height: 100px;
position: absolute;
width:100px;height:100px;
left:0; margin-left: auto;
right:0; margin-right: auto;
border:1px solid red;
color:red;
top:0; margin-top: auto;
bottom:0;margin-bottom: auto;
background-color: lightblue;
}
.box1 p{
position: absolute;
width:100px;height:40px;
border: 1px solid blue;
}
</style>
<script>
$(document).ready(function(){
$('.box1').hover(
function(){
$('.box1 h1').animate({
top:'-200px',
left:'-200px',
backgroundColor:'#9e9',
rotate: '30deg'
},1000)
},
function(){
$('.box1 h1').animate({
top:'0',
left:'0',
backgroundColor:'#ede',
rotate: '0deg'
},1000)
}
);
$('.box1 p').css(
{'color':'red',
'fontSize':'40px'
});
});
</script>
</head>
<body>
<div class='box1'>
<h1>hello</h1>
<p>baby</p>
</div>
</body>
jquery-animate-css-rotate-scale-master.zip다운받는곳 : https://github.com/zachstronaut/jquery-animate-css-rotate-scale/
'웹관련 > JavaScript-Jquery' 카테고리의 다른 글
[Jquery] 제이쿼리 ON 이벤트관련 (0) | 2016.09.22 |
---|---|
[자바스크립트] animate 속성정리 (0) | 2016.09.22 |
[자바스크립트] 이미지 프리로딩 (window.load) (0) | 2016.06.10 |
[Jquery] 핵심노드 다루기 (0) | 2016.06.10 |
[자바스크립트] 스르르 넘어가게 해주는 제이쿼리 소스 (원하는위치로 ex:탑으로) (0) | 2016.06.10 |
댓글