久久资源网

创意的圆角图片手风琴代码

创意的圆角图片手风琴代码

2019-06-20 11:48:23 选项卡/滑动门 admin

售价:5.00积分 会员免费 收藏

特别声明:资源售价只是赞助,不代表代码或者素材本身点数。收取费用仅维持本站的日常运营所需!

创意的圆角图片手风琴代码

使用jQuery写的水平滑动的手风琴特效,css3属性图片布局,兼容处理各种自适应屏幕大小的圆角图片手风琴布局代码。

使用方法

1、head引入css文件

<link rel="stylesheet" href="css/style.css"/>

2、head引入js文件

<script src="js/jquery.min.js"></script>

3、body引入部分

<div class="dowebok">
  <div class="options">
    <div class="option active" style="--optionBackground:url(../images/1.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-walking"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/2.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-snowflake"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/3.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-tree"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/4.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-tint"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/5.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-sun"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
  </div>
<div class="dowebok">
  <div class="options">
    <div class="option active" style="--optionBackground:url(../images/1.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-walking"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/2.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-snowflake"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/3.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-tree"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/4.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-tint"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
    <div class="option" style="--optionBackground:url(../images/5.jpg);">
      <div class="shadow"></div>
      <div class="label">
        <div class="icon"> <i class="fas fa-sun"></i> </div>
        <div class="info">
          <div class="main">这是标题</div>
          <div class="sub">这是一段描述</div>
        </div>
      </div>
    </div>
  </div>
</div>
<script >
	$(".option").click(function () {
    $(".option").removeClass("active");
    $(this).addClass("active");
});
	</script>/div>
<script >
	$(".option").click(function () {
    $(".option").removeClass("active");
    $(this).addClass("active");
});
	</script>

发表评论

用户头像 游客
此处应有掌声~

评论列表

还没有评论,快来说点什么吧~

关注微信