jquery鼠标滑过图片弹出
2017-02-14 15:30
281 查看
<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>
相关文章推荐
- JQuery1——基础($对象,选择器,对象转换)
- JavaScript演示排序算法
- 2015-2016网页设计趋势分析 Web Design of Trends
- jQuery Ajax 跨域调用
- 移动端的长按事件
- jquery教程靠边站,一分钱不花让你免费学会jquery
- JQuery+Strusts1.x无刷新登录
- $.ajax()方法详解
- jQuery ajax - ajax() 方法
- JQuery实例
- JavaScript 各种遍历方式详解
- 数组方法汇总
- seajs学习教程之基础篇
- jQuery Html控件基本操作(日常收集整理)
- jQuery插件实现文字无缝向上滚动效果代码
- jQuery菜单插件用法实例
- JQuery 初体验(建议学习jquery)
- 基于Jquery和CSS3制作数字时钟附源码下载(CSS3篇)
- Jquery实现的table最后一行添加样式的代码
- jQuery实现向下滑出的平滑下拉菜单效果