鼠标移入或经过,div以中心为原点放大
展开全部
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script class="jquery library" src="/js/sandbox/jquery/jquery-1.8.2.min.js" type="text/javascript"></script>
<title>
RunJS 演示代码
</title>
<style>
*{
margin:0;
padding:0;
}
.content{
width:100px;
height:100px;
border:1px solid red;
left:100px;
top:100px;
position:absolute;
text-align:center;
line-height:100px;
cursor:pointer;
background-color:#fd3;
}
</style>
<script>
$(function(){
var me = $(".content");
me.hover(function(){
me.stop().animate({
width: "+=50px",
height: "+=50px",
lineHeight: "+=50px",
top: "-=25px",
left: "-=25px"
}, 500);
},function(){
me.stop().animate({
width: "-=50px",
height: "-=50px",
lineHeight: "-=50px",
top: "+=25px",
left: "+=25px"
}, 500);
});
});
</script>
</head>
<body>
<div class='content'>d</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询