js实现图片显示局部,鼠标经过显示全部的效果
2008-01-23 00:00
1106 查看
这个是例如了CSS的margin负值和相对定位做的一个图片放大的效果。图片开始只是局部的,鼠标放上去显示整个图片。
无标题文档
body{ font-size:12px; }
ul,li,ol{ margin:0; padding:0; list-style:none; }
.box{ margin:100px; clear:both; border:1px solid #000; }
.box ul li{ list-style:none; float:left; width:60px; height:60px; margin-left:10px; text-align:center; border:1px solid #ccc; }
.box ul li a{ display:block; background:#f2f2f2; width:60px; height:60px; overflow:hidden; }
.box a img{ margin:-25px 0px 0px -25px; border:0; }
.box a:hover{ width:105px; height:140px; border:4px solid #f2f2f2; margin:-40px -50px -80px -50px; padding:1px; position:relative; }/* 设置相对定位后才能盖住后面的层 */
.box a:hover img{ margin:0; border:0; }
.clear{clear:both;overflow:hidden;height:0;}
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
无标题文档
body{ font-size:12px; }
ul,li,ol{ margin:0; padding:0; list-style:none; }
.box{ margin:100px; clear:both; border:1px solid #000; }
.box ul li{ list-style:none; float:left; width:60px; height:60px; margin-left:10px; text-align:center; border:1px solid #ccc; }
.box ul li a{ display:block; background:#f2f2f2; width:60px; height:60px; overflow:hidden; }
.box a img{ margin:-25px 0px 0px -25px; border:0; }
.box a:hover{ width:105px; height:140px; border:4px solid #f2f2f2; margin:-40px -50px -80px -50px; padding:1px; position:relative; }/* 设置相对定位后才能盖住后面的层 */
.box a:hover img{ margin:0; border:0; }
.clear{clear:both;overflow:hidden;height:0;}
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
相关文章推荐
- js实现图片显示局部,鼠标经过显示全部的效果
- js实现图片显示局部,鼠标经过显示全部的效果
- JS实现鼠标经过用户头像显示资料卡的效果,可点击
- JS实现鼠标移动到缩略图显示大图的图片放大效果
- jquery插件实现鼠标经过图片右侧显示大图的效果(类似淘宝)
- js和css两种实现鼠标经过图片时显示透明框的遮罩条文字
- 纯css3实现鼠标经过图片显示描述的动画效果
- JS实现鼠标移动到缩略图显示大图的图片放大效果
- 原生JS实现鼠标悬停图片显示文字效果
- JS实现鼠标经过用户头像显示资料卡的效果,可点击
- js实现将图片裁切成方形显示,鼠标移入放大效果
- 分享一个jquery插件:实现类似淘宝上鼠标经过图片右侧显示大图的效果
- JS实现鼠标经过好友列表中的好友头像时显示资料卡的效果
- JS实现鼠标经过好友列表中的好友头像时显示资料卡的效果
- jQuery实现鼠标经过图片预览大图效果
- jQuery实现鼠标经过图片预览大图效果
- 30款css3实现的鼠标经过图片显示描述特效
- JS实现鼠标滑过图片的抖动效果