gsap+Draggable实现左右拖拽图片列表排列效果代码

代码语言:html

所属分类:拖放

代码描述:gsap+Draggable实现左右拖拽图片列表排列效果代码

代码标签: gsap Draggable 左右 拖拽 图片 列表 排列

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.wrapper {
  width: 100%;
  height: 100vh;
  background-color: black;
  display: flex;
  align-items: center;
}

.container {
  width: 100%;
  height: 400px;
  /* border: 1px solid tomato; */
  overflow: hidden;
}

.cards {
  display: flex;
  gap: 50px;
  /* border: 2px solid fuchsia; */
  padding: 0 50px;
}

.card {
  height: 100%;
  overflow: hidden;
  /* border: 1px solid teal; */
  flex: 1 0 25%;
}

.card img {
  object-fit: cover;
  object-position: center;
}
</style>


  
</head>

<body translate="no">
  <div class="wrapper">
  <div class="container">
    <div class="cards">
      <div class="card">
        <img src="//repo.bfw.wiki/random/700x500/夏天" alt="">
      </div>
      <div class="card">
        <img src="//repo.bfw.wiki/random/700x500/景色" alt="">
      </div>
      <div class="card">
        <img src="//repo.bfw.wiki/random/700x500/雪景" alt="">
      </div>
      <div class="card">
        <img src="//repo.bfw.wiki/random/700x500/山脉" alt="">
      </div>
      <div class="card">
        <img src="//repo.bfw.wiki/random/700x500/河流" alt="">
      </div>
      <div .........完整代码请登录后点击上方下载按钮下载查看

网友评论0