jquery实现鼠标经过图片旋转动画展示
css代码
<style type="text/css"> *{margin:0;padding:0;list-style-type:none;} a,img{border:0;text-decoration:none;} body{font:12px/180% Arial, Helvetica, sans-serif, "新宋体";} /* allbrand */ .allbrand .brand{width:390px;height:225px;overflow:hidden;margin:40px auto 0 auto;} .allbrand .brand a{display:inline;position:relative;float:left;width:120px;height:70px;line-height:70px;text-align:center;color:#fff;font-size:14px;margin:0 6px 5px 0;} .allbrand .brand a img{position:absolute;left:10px;width:118px;height:68px;border:1px solid #e9e8e8;} .allbrand .brand a b{display:none;position:absolute;top:36px;left:10px;width:118px;height:0;background:#000;border:1px solid #e9e8e8;cursor:pointer;overflow:hidden;} </style>
html内容
<div class="allbrand"> <div class="brand"> <a target="_blank" href="http://www.17sucai.com/"><img alt="兰芝" src="images/20121119104931.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="丝塔芙" src="images/20121015052055.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="玉兰油" src="images/20121123030707.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="高丝" src="images/20121210102224.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="美宝莲" src="images/20121220100203.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="水之密语" src="images/20130106112242.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="曼秀雷敦" src="images/20121220100514.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="JUST BB" src="images/20130106112655.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="玉兰油" src="images/20121123030707.jpg" /></a> </div> <div class="brand"> <a target="_blank" href="http://www.17sucai.com/"><img alt="兰芝" src="images/20121119104931.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="丝塔芙" src="images/20121015052055.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="玉兰油" src="images/20121123030707.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="高丝" src="images/20121210102224.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="美宝莲" src="images/20121220100203.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="水之密语" src="images/20130106112242.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="曼秀雷敦" src="images/20121220100514.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="JUST BB" src="images/20130106112655.jpg" /></a> <a target="_blank" href="http://www.17sucai.com/"><img alt="玉兰油" src="images/20121123030707.jpg" /></a> </div> </div>
js代码 不要忘记引用jquery
//品牌翻转 var allBrandAnimate = function(t,d){ if(t.find('.brand b').length != 0){ return false; } t.find('.brand a').each(function(){ $(this).append('<b>' + $(this).find('img').attr('alt') + '</b>') }); t.find('.brand a').hover(function(){ $(this).find('img').stop().animate({'height':0,'top':'35px'},d,function(){ $(this).hide().next().show(); $(this).next().animate({ 'height':'70px', 'top':'0' },d); }); },function(){ $(this).find('b').animate({'height':0,'top':'35px'},d,function(){ $(this).hide().prev().show(); $(this).prev().animate({ 'height':'70px', 'top':'0' },d); }); }); } allBrandAnimate($('.allbrand'),80);
转载请注明:jquery实现鼠标经过图片旋转动画展示 - 编程知识库
您可能还会对这些文章感兴趣
2016-12-20 1,786次只会用jQuery前端到底low不low?
如果你之前没有看过我的《前端工程师如何月薪过4万》这里建议大家仔细读读一下,因为里面有整个前端工程师成长的技术路线图和我的故事。同时很多小伙伴问我的学历后来没再考考么,我是考了成考的北京航空航天大学,也马上快毕业了。不过我觉得这件事不足为提,因为国...
2016-12-17 721次jquery的$().each,$.each的区别
在jquery中,遍历对象和数组,经常会用到$().each和$.each(),两个方法。两个方法是有区别的,从而这两个方法在针对不同的操作上,显示了各自的特点。 $().each,对于这个方法,在dom处理上面用的较多。如果页面有多个input标签类型为checkbox,对于这时用$().each来...
2016-12-15 1,853次jquery加载外部文件(.txt .html)显示在网页上
在web开发中常常需要用到jquery去动态的加载文件显示在网页上面,下面是实现的小方法,希望给大家一点提示,达到抛砖引玉的作用哦!!! 效果图: 要加载显示的文件: 网页加载效果: html代码截图: jquery代码截图: 转载请注明:jquery加载外部文件(.txt ....
2016-12-15 665次javascript实现网页倒计时
web开发中常常需要使用到网页倒计时功能,下面是实现方法: 效果图: 代码截图: 转载请注明:javascript实现网页倒计时 - 编程知识库
大家正在看
- linux 系统中Mysql 进程占用cpu过高的解决
- 二类电商是什么意思? 二类电商有哪些?暴利二类电商还好做吗?
- 【二类电商广点通投放指南】二类电商广点通投放值不值
- 密码保护:支付宝突破微信封锁唤起支付宝代码
- Host is not allowed to connect to this MySQL server解决方法
- 密码保护:移动端js自动复制代码
- linux数据库调优,WordPress MySQL占用cpu高数据库优化
- 2017 年十大网页设计趋势
- 网页端的VR实现离我们还远么?
- 最完整的Chrome浏览器客户端调试大全
- iPhone用户人均每天遭电话骚扰1次
- 3G电子化销售服务系统
- Java WeakReference的理解与使用
- 搞清楚 Python traceback