京东首页闪光滑动效果小记(转载)
2015-09-22 16:37
323 查看
http://www.w3cfuns.com/blog-5473326-5409149.html
<html>
<head>
<style>
.overimg{
position: relative;
display: block;
overflow: hidden;
box-shadow: 0 0 10px #FFF;
width:180px;
}
.light{
cursor:pointer;
position: absolute;
left: -180px;
top: 0;
width: 180px;
height: 90px;
background-image: -moz-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
background-image: -webkit-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
transform: skewx(-25deg);
-o-transform: skewx(-25deg);
-moz-transform: skewx(-25deg);
-webkit-transform: skewx(-25deg);
}
.overimg:hover .light{
left:180px;
-moz-transition:0.5s;
-o-transition:0.5s;
-webkit-transition:0.5s;
transition:0.5s;
}
</style>
</head>
<body>
<p class="overimg">
<a><img src="http://www.nowamagic.net/librarys/images/201402/2014_02_15_01.jpg"></a>
<i class="light"></i>
</p>
<a href="http://www.nowamagic.net/librarys/veda/detail/2600" target="_blank"> 最后附上原效果地址,原效果未加overflow:hidden和设置p的宽度,作者进行了一些小小的优化</a>
</body>
</html>
<html>
<head>
<style>
.overimg{
position: relative;
display: block;
overflow: hidden;
box-shadow: 0 0 10px #FFF;
width:180px;
}
.light{
cursor:pointer;
position: absolute;
left: -180px;
top: 0;
width: 180px;
height: 90px;
background-image: -moz-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
background-image: -webkit-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
transform: skewx(-25deg);
-o-transform: skewx(-25deg);
-moz-transform: skewx(-25deg);
-webkit-transform: skewx(-25deg);
}
.overimg:hover .light{
left:180px;
-moz-transition:0.5s;
-o-transition:0.5s;
-webkit-transition:0.5s;
transition:0.5s;
}
</style>
</head>
<body>
<p class="overimg">
<a><img src="http://www.nowamagic.net/librarys/images/201402/2014_02_15_01.jpg"></a>
<i class="light"></i>
</p>
<a href="http://www.nowamagic.net/librarys/veda/detail/2600" target="_blank"> 最后附上原效果地址,原效果未加overflow:hidden和设置p的宽度,作者进行了一些小小的优化</a>
</body>
</html>
相关文章推荐
- C++隐式转换
- js的时间戳和php的时间戳转换需要注意的地方
- Viewport vs Page
- Android开发中怎样调用系统Email发送邮件(多种调用方式)
- Bluetooth SIG profiles
- hihocoder 1233 Boxes(bfs+状态压缩+hash表)
- 使用git@osc管理现有项目
- Eclipse导入外部项目无法识别为web项目并且无法在部署到tomcat下
- 什么是 Angularjs
- cpc(国际专利标准)离线客户端文档制作公式失真(字体变粗变黑)问题解决方案以及常见注意事项
- thrift 库使用心得
- shareSDK 新浪取消授权
- Android :利用Proguard去除日志信息
- RandomAccessFile的使用
- java 生成 word方案
- 基础四:ContentProvider
- 一个简单的图片切换效果
- Mysql5.6.26 绿色版安装与配置
- xmlns:xsi ——是指xml文件遵守xml规范,xsi全名:xml schema instance
- MVC 认识