jquery实现盒子下拉效果

来源:互联网 发布:淘宝手机一键生成 编辑:程序博客网 时间:2024/06/04 00:21
<script src="js/Jquery1.7.js"></script>    <script type="text/javascript">        $(function () {            $('div:eq(1)').css({ 'margin-top': '-=100px' });            $('div:first').mouseover(function () {                $('div:eq(1)').animate({'margin-top':'+=100px'});            })            $('div:first').mouseout(function () {                $('div:eq(1)').animate({ 'margin-top': '-=100px' });            })    </script>


<div style="width:600px;height:300px;overflow:hidden;">        <div style="background-color:#000;height:100px;">        </div>        <div style="background-color:#eee;height:300px;">                    </div>    </div>

当把鼠标移动到盒子上的时候上面就会出现一个黑色的盒子
这是在浏览网页的时候看到的一个效果
在这里写了一下
原创粉丝点击