<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
*{
margin:0;
padding:0;
}
.wrapper{
width: 938px;
height: 128px;
border: 1px solid #d3d3d3;
}
.wrapper li{
width: 156px;
height: 128px;
float:left;
overflow: hidden;
position: relative;
}
.wrapper li a{
display: block;
height: 128px;
width: 156px;
overflow: hidden;
}
.wrapper li a img{
position: absolute;
bottom: 0;
right: 0;
height: 72px;
width: 117px;
}
.wrapper .info{
position: absolute;
top: 0;
left: 0;
width: 136px;

}
.wrapper .info h3{
font-size: 14px;
font-weight: 700;
}
.wrapper .info p{
color:#868686;
font-size: 12px;
height: 22px;
line-height: 22px;
width: 136px;
}
.wrapper .info .price{
font-size: 14px;
font-style: italic;
color: #fa2a5d;
height: 35px;
}
.wrapper .line{
position: absolute;
right: 0;
top: 0;
}
.wrapper .mask{
position: absolute;
top:0;
left: 0;
height: 128px;
width: 156px;
background-color: #CCCCCC;
opacity:0;
}
.wrapper:hover .mask{
opacity: 0.3;
}
.wrapper ul *{
transition: all linear 0.2s;
}
.wrapper li.big, li.big a{
width: 314px;
}
.wrapper li.big img{
width: 196px;
height: 120px;
right: 0;
bottom: 0;
}
.wrapper li.big .info{
width: 290px;
}
.wrapper li.big h3{
font-size: 18px;
}
.wrapper li.big .info{
width: 290px;
}
.wrapper li.big h3{
font-size: 18px;
}
.wrapper li.big p{
font-size: 14px;
width: 166px;
}
.wrapper li.big p.price{
font-size: 16px;
padding-top: 7px;
}
.wrapper li.big a:hover .mask{
opacity: 0;
}
.line{
position: absolute;
right: 0;
width: 0;
height: 128px;
border: 1px dashed #ccc;
}
</style>
<body>
<div id="subject" class="wrapper">
<ul>
<li>
<a href="#">
<img src="img/img/e6657ca7-c4c5-43fc-9bd6-29999102fc61.jpg"/>
<div class="info">
<h3 style="color:#f62368">美妆品牌</h3>
<p>2周年</p>
<p class="price"><strong>1</strong><i>折起</i></p>
</div>
<i class="line"></i>
<i class="mask"></i>
</a>
</li>
<li class="big">
<a href="#">
<img src="img/img/e6657ca7-c4c5-43fc-9bd6-29999102fc61.jpg"/>
<div class="info">
<h3 style="color:#f62368">美妆品牌</h3>
<p>2周年</p>
<p class="price"><strong>1</strong><i>折起</i></p>
</div>
<i class="line"></i>
<i class="mask"></i>
</a>
</li>
<li>
<a href="#">
<img src="img/img/e6657ca7-c4c5-43fc-9bd6-29999102fc61.jpg"/>
<div class="info">
<h3 style="color:#f62368">美妆品牌</h3>
<p>2周年</p>
<p class="price"><strong>1</strong><i>折起</i></p>
</div>
<i class="line"></i>
<i class="mask"></i>
</a>
</li>
<li>
<a href="#">
<img src="img/img/e6657ca7-c4c5-43fc-9bd6-29999102fc61.jpg"/>
<div class="info">
<h3 style="color:#f62368">美妆品牌</h3>
<p>2周年</p>
<p class="price"><strong>1</strong><i>折起</i></p>
</div>
<i class="line"></i>
<i class="mask"></i>
</a>
</li>
<li>
<a href="#">
<img src="img/img/e6657ca7-c4c5-43fc-9bd6-29999102fc61.jpg"/>
<div class="info">
<h3 style="color:#f62368">美妆品牌</h3>
<p>2周年</p>
<p class="price"><strong>1</strong><i>折起</i></p>
</div>
<i class="line"></i>
<i class="mask"></i>
</a>
</li>
</ul>
</div>
</body>
<script type="text/javascript">
window.onload=function() {
initList();
function initList() {
var outer=document.getElementById("subject");
var list=outer.getElementsByTagName('li');
for(var i=0;
i < list.length;
i++) {
bind(list[i], 'mouseover', mouseoverhandler);
}
}
function bind(el, eventType, callback) {
if(typeof el.addEventListener=='function') {
el.addEventListener(eventType, callback, false);
}
else if(typeof el.attachEvent==='function') {
el.attachEvent('on'+ eventType, callback);
}
}
function mouseoverhandler(e) {
var target=e.target || e.srcElement;
var outer=document.getElementById("subject");
var list=outer.getElementsByTagName('li');
for(var i=0;
i < list.length;
i++) {
list[i].className="";
}
while(target.tagName !='LI' || target.tarName=='BODY') {
target=target.parentNode;
}
target.className="big";
}
}
</script>
</html>

JS手风琴特效的更多相关文章

  1. 动漫网站基于jquery的横向手风琴特效

    今天给大家分享一款动漫网站基于jquery的横向手风琴特效.这款手风琴特效适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: 在线预 ...

  2. 图片每天换及纯css3手风琴特效

    <a target="_blank" id="a"><img id="img" /></a> <s ...

  3. 未封装的js放大镜特效

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>j ...

  4. js手风琴图片切换实现原理及函数分析

    关键词: js手风琴 js百叶窗 js百页窗 实现原理解读 使用两层for循环实现, 第一层有三个功能,分别给第个li: 添加索引 预设位置 添加事件 第二层有两个功能,整理图片位置: 鼠标的li,以 ...

  5. 一款点击图片进行无限循环的jquery手风琴特效

    一款点击图片进行无限循环的jquery手风琴特效,点击手风琴折合点,可以无限循环的点击下去,很炫酷的手风琴哟! 还有每张图片的文字介绍,因为兼容IE6所以找来分享给大家这个jquery特效. 适用浏览 ...

  6. 第五章 JS典型特效

    注意: 1.JS在HTML中从上到下依次执行,所以获取元素的结果与JS的位置有关 <!DOCTYPE html> <html> <head> <title&g ...

  7. Three.js粒子特效,shader渲染初探(一篇非常详细的介绍)

    Three.js粒子特效,shader渲染初探 转载来源:https://juejin.im/post/5b0ace63f265da0db479270a 这大概是个序 关于Three.js,网上有不多 ...

  8. js 时钟特效

      时钟特效 CreateTime--2018年2月24日15:11:23 Author:Marydon 实现方式:都是基于HTML5的canvas标签实现的 款式一 借助jQuery插件实现 < ...

  9. 纯js代码实现手风琴特效

    我知道现在大多数前端开发人员都在使用jQuery等第三方的库来进行开发,这不仅节约了时间,也让效率大大的提高,并让公司的效益增加,何乐而不为呢? 但是,这也会有一定的缺点,比如jQ比js慢,尤其在大型 ...

随机推荐

  1. Mac下安装ElasticSearch及其插件

    目录 环境介绍 安装过程 安装Kibana 环境介绍 软件版本:ElasticSearch7.0.0 Kibana7.0.0 系统环境:mac 环境 安装过程 官网下载 ElasticSearch7. ...

  2. EF6 CodeFirst连接MySql 报nvarchar('max')错误解决办法

    1.在DBContext类加标签[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] 2.在Nuget控制台输入u ...

  3. C++string类型转换为C数组

    #include <string> #include <iostream> using namespace std; int main(){ string str; str.a ...

  4. 2017微软骇客马拉松精彩大回Fun:不一样的Hacker,一Young的Cool

    丹棱君有话说:一年一度激动人心的骇客马拉松大会结束了!这场内部创意大比拼硕果累累,丹棱君准备好了 6 组 Cool 骇客的别 Young 作品——沉浸式销售工具如何能守得“云”开见月明?“骇客马拉松超 ...

  5. github上fork原项目,如何将本地仓库代码更新到最新版本?

    场景: 在github上fork原项目,项目组成员发起pull request提交了代码,这时自己在本地仓库该如何更新到最新代码? 操作方法如下: 方法一.从github上进行操作然后更新 登录自己的 ...

  6. python基础教程总结15——3 XML构建网址

    要求: 网址用一个XML文件描述,其中包括独立网页和目录的信息: 程序能创建所需的目录和网页: 可以改变网址的设计,并且以新的设计为基础重新生成所有网页 概念: 网站:不用存储有关网站本身的任何信息, ...

  7. 2017-3-7-lint82single-number

    2017-3-7-lint82single-number 在河之洲 算法 小书匠 problem 82single-number/ solution int singleNumber(vector&l ...

  8. CF Gym 100187B A Lot of Joy (古典概型)

    题意:给两个一样的只含有26个小写字母的字符串,然后两个分别做一下排列,问如果对应位置的字母相等那么就愉悦值就加一,问愉悦值的期望是多少? 题解:只考虑两个序列相对的位置,那么就相当于固定一个位置,另 ...

  9. Adobe登陆出现Access denied解决方法

    当我安装好Adobe Acrobat Reader DC时,想要登陆Adobe账号时被Access denied. 一般说需要梯子,然而本人亲测这种方法不行(香港主机,全局模式下). 一个简单有效的方 ...

  10. websocket+订阅发布者模式模拟实现股票价格实时刷新

    1.新建文件夹 2.文件夹中新建index.html 和 index.js index.html <!DOCTYPE html> <html lang="en"& ...