精彩专题推荐:建站之入门课 建站之必修课 建站之关键课 网站价值所在 流量提高专题 css+div 标准 个人网站打造全过程
返回建站学首页
导航:
建站首页 | 网站设计 | 网站开发 | 网站运营 | 网页软件 | 建站指南 | 搜索优化 | 图像处理 | 视频教程 | 书籍教程 | 建站专题
当前位置:首页>网站设计>网页特效>正文

CSS的“弹出式”图像浏览器


来源: 时间:06-09-11 点击: 点击这里收藏本文

CSS的”弹出式“图像浏览器

转自Dynamic Drive,纯CSS的,原理就是在a标记里面放两张图片,一张大图,一张小图,正常情况下小图可见,大图隐藏,a:hover就显示大图了

以下是引用片段:
<style type="text/css">

.thumbnail{
position: relative;
z-index: 0;
}

.thumbnail:hover{
background-color: transparent;
z-index: 50;
}

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */

}

</style>
<a class="thumbnail" href="#thumb"><img src="http://www.jzxue.com/Files/BeyondPic/2006-9/11/tree_thumb.jpg" width="100px" height="66px" border="0" /><span><img src="http://www.jzxue.com/Files/BeyondPic/2006-9/11/tree.jpg" /><br />Simply beautiful.</span></a>

<a class="thumbnail" href="#thumb"><img src="http://www.jzxue.com/Files/BeyondPic/2006-9/11/ocean_thumb.jpg" width="100px" height="66px" border="0" /><span><img src="http://www.jzxue.com/Files/BeyondPic/2006-9/11/ocean.jpg" /><br />So real, it's unreal. Or is it?</span></a>



  把此文章收藏到:          
广而告之
文章搜索
  • Google JZxue.Com

关于我们 | 联系我们 | 友情链接 | 网站地图
Copyright © 2005 - 2006 建站学 All rights reserved.