jquery图片列表鼠标移入微动实现代码

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

其中的jQuery事件使用mouseenter 和 mouseleave ,事件绑定方法使用新推荐的on方法。

代码如下:

<!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=https://.oss-cn-hangzhou.aliyuncs.com/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=https://.oss-cn-hangzhou.aliyuncs.com/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=https://.oss-cn-hangzhou.aliyuncs.com/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=https://.oss-cn-hangzhou.aliyuncs.com/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=https://.oss-cn-hangzhou.aliyuncs.com/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=https://.oss-cn-hangzhou.aliyuncs.com/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="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>

以上就是jquery图片列表鼠标移入微动实现代码的全部内容,希望大家在看完之后会有所帮助。

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索代码
, 事件
this
鼠标微动、鼠标换微动、鼠标微动怎么换、鼠标微动是什么、鼠标换微动教程,以便于您获取更多的相关知识。

时间: 2024-08-19 16:01:21

jquery图片列表鼠标移入微动实现代码的相关文章

jquery实现图片列表鼠标移入微动_jquery

本效果使用jQuery和CSS实现了图片列表,当鼠标移入时图片向左微动,移出则复原. 其中的jQuery事件使用mouseenter 和 mouseleave ,事件绑定方法使用新推荐的on方法. 代码如下: <!DOCTYPE html> <html> <head><meta name="viewport" content="width=device-width, initial-scale=1" /> <ti

jquery 提示插件鼠标移上圆角框图片提示

  <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head>  <meta http-equiv="content-type" content="text/html;charset=gb2312"/>  <title>

用jQuery toggleClass 实现鼠标移上变色_jquery

按钮移上变色效果 复制代码 代码如下: <style> .round-corner-btn { -moz-border-radius:4px; -webkit-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; width:200px; height:40px; line-height: 40px; background: green; display:inline-block; color:white; tex

jquery 图片上传本地预览效果代码

 代码如下 复制代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.111cn.net /1999/xhtml" > <head>     <meta http-

html则样将这张图片,用鼠标移去切换????

问题描述 html则样将这张图片,用鼠标移去切换???? 解决方案 ??????????????求大神指点 解决方案二: 不明白你的意思,能说清楚点吗 解决方案三: 感觉有多个实现方式:鼠标移上去事件, 1通过这个事件我们可以替换明亮度不一的图片,鼠标移走后又替换回来!2通过这个隐藏暗的图片,显示亮的图片,事件一走又隐藏亮的显示暗的!这一切和动作通过jquery都可以很简单的实现的! 解决方案四: 这一切和动作通过jquery都可以很简单的实现的! 解决方案五: 这一切和动作通过jquery都可

asp.net下用js实现鼠标移至小图,自动显示相应大图_实用技巧

实现根据后台绑定小图片,鼠标移至小图,自动显示相应大图  .Net精简版本  <script language="JavaScript">         function GetShowImg(imgfile)      {      document.all("ShowImage").src = "/semir/images/"+ imgfile;     }          </script>    //DataL

如何改进jquery的mousemove处理程序,使得在鼠标移进图片时每秒钟最多记录5次位置信息?

问题描述 如何改进jquery的mousemove处理程序,使得在鼠标移进图片时每秒钟最多记录5次位置信息? $(document).on('mousemove', 'div.photo', function(event) { var $text='X: '+event.pageX+' || '+'Y: '+event.pageY; console.log($text.length) });

jquery插件-jquery哪个插件可以实现:将鼠标移到图片上,会出现大图,就像京东那样?

问题描述 jquery哪个插件可以实现:将鼠标移到图片上,会出现大图,就像京东那样? jquery哪个插件可以实现:将鼠标移到图片上,会出现大图,就像京东那样? 解决方案 http://www.jb51.net/jiaoben/259626.html

JQuery鼠标移到小图显示大图效果的方法_jquery

本文实例讲述了JQuery鼠标移到小图显示大图效果的方法.分享给大家供大家参考.具体分析如下: 这里的显示大图功能类似上一篇<JQuery实现超链接鼠标提示效果的方法>,稍微修改一下代码,就可以做出一个图片的提示效果. 参考前面的超链接提示效果的代码,只需要将创建的div元素的代码改为: //创建 div 元素 图片提示 var tooltip = "<div id="tooltip"><img src=""+ this.hr