jquery 鼠标移动放大标签里的内容

目的:img标签鼠标移动上去时放大。鼠标移走时缩小。

1、添加动作和引用jquery

<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript"> $(document).ready(function(){ $(".big").mouseover(function(){ $(this).css("height","50px"); }); $(".big").mouseout(function(){ $(this).css("height","10px"); }); }); </script>

2、img标签添加class=big

<img  class="big" style="width:500px;height:20px;position:absolute;top:0;left:0;" src=
"./pics/0.1.jpg" />

3、此<script>标签放哪儿都可以。推荐放body底部最佳。

 调试:alert(arrPic.length)就会出现消息框提示这个arrPic.length的值

posted @ 2018-03-14 09:39  呼噜喵喵  阅读(225)  评论(0编辑  收藏  举报