jquery鼠标滑过图片弹出

来源:互联网 发布:什么是java的反射机制 编辑:程序博客网 时间:2024/04/28 21:15
 <script src="../jquery-1.12.4.js"></script>
css属性    <style>        *{            margin: 0px;            padding: 0px;        }        .img1{
注意,一定要是小的图片绝对定位            position: absolute;            width: 80px;            height: 320px;            float: left;            margin-left: -5px;        }        .img2{            height: 320px;            float: left;            margin-left: -350px;        }    </style></head><body>        <div class="div1">            <img src="../img/8.jpg" alt="" class="img1">            <img src="../img/7.jpg" alt="" class="img2">        </div></body><script>    $('.div1').hover(function(){        $('.img2').animate({'margin-left':'75px'},500).clearQueue;    }, function () {        $('.img2').animate({'margin-left':'-350px'},500).clearQueue;    })  /* $('.div1').mouseenter(function(){       //$('.img2').css({'display':'block'})        $('.img2').animate({'margin-left':'75x'},500).clearQueue();    })    $('.div1').mouseleave(function () {        $('.img2').animate({'margin-left':'-350px'},500).clearQueue();    })*/</script></html>

0 0
原创粉丝点击