html实现手风琴轮播图,javascript经典特效分享 手风琴、轮播图、图片滑动

最近都没有更,就来几个效果充实一下。

都没有进行美化这步。

纯css的手风琴:

9167c1bd8748ab6aff05975b1e36be42.gif

手风琴css

.showBox{

width: 660px;

overflow: hidden;

}

ul{

list-style: none;

margin: 0;

padding: 0;

width: 30000px;

}

ul li{

float: left;

position: relative;

height: 254px;

width: 110px;

overflow: hidden;

transition: all 0.3s;

}

/* 这是css手风琴的核心,就是hover的使用

**首先是ul:hover li这个触发了经过ul但没有经过li的变化

**然后是ul li:hover这里是被经过li的变化,匹配css3动画效果,

和css3的一些对页面美化的效果,就可以做出一个很好看的手风琴,

如果使用纯js实现可能很麻烦。

*/

ul:hover li{

width:22px;

}

ul li:hover{

width: 460px;

}

ul li img{

width: 550px;

height: 254px;

}

ul li span{

width: 22px;

position: absolute;

top: 0;

right: 0;

height: 204px;

padding-top: 50px;

color: #fff;

}

ul li span.bg1{

background: #333;

}

ul li span.bg2{

background: #0f0;

}

ul li span.bg3{

background: #ff7500;

}

ul li span.bg4{

background: #0ff;

}

ul li span.bg5{

background: #00f;

}

  • 这是第一个
  • 这是第二个
  • 这是第三个
  • 这是第四个
  • 这是第五个

css3手风琴:

93c150eeaa6f0e03000307a256a5e21e.gif

css3-checked:

/* 使用了radio的单选特性,实现手风琴效果 */

ul{

display: none;

}

input{display: none;}

label{display: block; line-height: 40px; border-bottom: 1px solid #ddd; cursor:pointer; font-size: 15px; font-weight: bold;}

.list > ul{display: none; -webkit-transition:all .5s linear; -moz-transition:all .5s linear; -ms-transition:all .5s linear; -o-transition:all .5s linear; transition:all .5s linear;}

#list1:checked + ul{display: block;}

#list2:checked + ul{display: block;}

#list3:checked + ul{display: block;}

#list4:checked + ul{display: block;}

javascript实现的手风琴:

e1d362619f422ed4453ca9e8f7584349.gif

手风琴

.showBox{

width: 660px;

overflow: hidden;

}

ul{

list-style: none;

margin: 0;

padding: 0;

width: 30000px;

}

ul li.active{

width: 550px;

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值