星空网 > 软件开发 > Java

jQ图片列表光标移动动画

本效果使用jQuery和CSS实现了图片列表,当鼠标移入时图片向左微动,移出则复原。

效果展示: http://hovertree.com/texiao/jquery/88/

效果图如下:
jQ图片列表光标移动动画

其中的jQuery事件使用mouseenter 和 mouseleave ,事件绑定方法使用新推荐的on方法。具体请参考:
http://hovertree.com/h/bjaf/ug1fikri.htm


代码如下:

<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width, initial-scale=1" />  <title>jQuery实现图片列表鼠标移入微动_何问起</title><base target="_blank" />  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  <style type="text/css">    body, div, li, p, img, a {      margin: 0;      padding: 0;    }    .hovertreecontainer {      width: 370px;      margin: 50px auto;    }      .hovertreecontainer a {        text-decoration: none;      }    .hovertree-item-box {      height: 120px;      width: 185px;      position: relative;      padding: 10px;      box-sizing: border-box;      float: left;    }      .hovertree-item-box .title {        width: 80px;        height: 100%;        color: #4998a1;        font-size: 14px;      }      .hovertree-item-box.odd {        border-bottom: 1px solid #CCC;        border-right: 1px solid #CCC;      }      .hovertree-item-box.even {        border-bottom: 1px solid #CCC;      }      .hovertree-item-box.nobottom {        border-bottom: none;      }      .hovertree-item-box .hovertree-img-box {        width: 80px;        height: 80px;        overflow: hidden;        position: absolute;        right: 10px;        bottom: 5px;      }    .hovertree-img-box img {      width: 100%;      height: 100%;    }    .hovertreecontainer:after {      content: "";      display: block;      clear: both;    }  </style></head><body>    <div class="hovertreecontainer"><h2>jQuery实现图片列表鼠标移入微动</h2>    <a href="http://hovertree.com/texiao/css/20/">      <div class="hovertree-item-box odd">        <div class="title">春节对联</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/201512/o9qashmi.gif"></div>      </div>    </a>    <a href="http://hovertree.com/hvtart/bjae/a6w6e2qg.htm">      <div class="hovertree-item-box even">        <div class="title">下雨天</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/201512/f748s0ko.jpg"></div>      </div>    </a>    <a href="http://hovertree.com/h/bjae/0st5ww13.htm">      <div class="hovertree-item-box odd">        <div class="title">磨砂玻璃</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/201512/agagq0or.jpg"></div>      </div>    </a>    <a href="http://hovertree.com/menu/texiao/">      <div class="hovertree-item-box even">        <div class="title">网页特效</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/201512/r51a22uy.gif"></div>      </div>    </a>    <a href="http://hovertree.com/h/bjaf/hwqtjwjs.htm">      <div class="hovertree-item-box odd nobottom">        <div class="title">何问起统计文件数</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/bjafjd/iofopnro.png"></div>      </div>    </a>    <a href="http://hovertree.com/h/bjaf/hovertreeimg.htm">      <div class="hovertree-item-box even nobottom">        <div class="title">HovertreeImg</div>        <div class="hovertree-img-box"><img src='/images/loading.gif' data-original="http://hovertree.com/hvtimg/201601/p3t2ldyr.png"></div>      </div>    </a>  <div><a href="http://hovertree.com/h/bjaf/4mv4wgmj.htm">原文</a> <a href="http://hovertree.com">首页</a> <a href="http://hovertree.com/menu/texiao/">特效</a></div>  </div>  <script type="text/javascript" src='/images/loading.gif' data-original="http://down.hovertree.com/jquery/jquery-1.11.3.min.js"></script>  <script type="text/javascript">    $(function () {      $('.hovertreecontainer .hover'+'tree-item-box').on('mouseenter', function (ev) {        var oImgBox = $(this).find('.hovertree-img-box');        $(oImgBox).stop(true).animate({          right: '20px'        }, "normal");      }).on('mouseleave', function (ev) {        var oImgBox = $(this).find('.hovertree-img-box');        $(oImgBox).stop(true).animate({          right: '10px'        }, "normal");      });    });  </script></body></html>

转自:http://hovertree.com/h/bjaf/4mv4wgmj.htm

特效汇总:http://www.cnblogs.com/jihua/p/webfront.html




原标题:jQ图片列表光标移动动画

关键词:jq

jq
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

香港公司会计注册流程及费用|常熟香港公司注册流程:https://www.ikjzd.com/articles/150792
申请香港公司注册流程|香港公司注册的流程程序:https://www.ikjzd.com/articles/150793
注册香港公司 流程|香港代购公司注册流程:https://www.ikjzd.com/articles/150794
​大陆在香港注册公司流程及费用|香港公司注册的流程程序:https://www.ikjzd.com/articles/150796
亚马逊旺季在即!如何做到高效站外引流?:https://www.ikjzd.com/articles/150797
帮助跨境卖家解决假日销售供应链问题10条办法!:https://www.ikjzd.com/articles/150798
九华山离哪个城市近?:https://www.vstour.cn/a/408248.html
你更喜欢一个人旅行,还是一群人旅行? :https://www.vstour.cn/a/408249.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流