如何实现当鼠标移到某个DIV上,该DIV自动放大120%,移开自动缩回100%?

如题,用JS、JQ都可以,只知道图片可以实现这个效果,那DIV可以实现吗?请高手不吝赐教,谢谢!

在div元素上添加监听事件,当mouseenter事件发生时,然后通过js或者使用jquery插件来获取div的样式,然后修改,比如$("你的元素id").css("height",120%),宽度同理;
然后离开的时候同样出发mouseleave或者mouseout,具体哪个忘了。
总之大致的思路就是这样。
望采纳
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-26
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
$("#test").mouseover(function(){
$(this).animate({width:"120%"},500);
}).mouseout(function(){
$(this).animate({width:"100%"},500);
});
});
</script>
</head>
<body>
<div style="width:100px;height:100px;">
<div id="test" style="width:100px;height:100px;border:1px solid blue;"></div>
</div>
</body>
</html>本回答被提问者采纳
相似回答