TweenMax+Draggable实现年份上下拖动选择器代码

代码语言:html

所属分类:选择器

代码描述:TweenMax+Draggable实现年份上下拖动选择器代码

代码标签: TweenMax Draggable 年份 上下 拖动 选择器 代码

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

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

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

  <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">


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

html, body {
  height: 100%;
  min-height: 100%;
  font-family: Roboto, sans-serif;
  background: #e2e0e0;
}

main {
  display: flex;
  position: relative;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.cell {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font-size: 26px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.87);
  color: rgba(0, 0, 0, 0.92);
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker {
  position: relative;
  overflow: hidden;
  width: 225px;
  border-radius: 2px;
  background-color: #fff;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
}
</style>

  
  
</head>

<body translate="no">
  <main>  
  <div id="picker" class="picker">
    <div class="cell">
      <div class="cell-content">2022</div>
    </div>     
    <div class="cell">
      <div class="cell-content">2023</div>
    </div>  
    <div class="cell">
      <div class="cell-content">2024</div>
    </div>  
    <div class="cell">
      <div class="cell-content">2025</div>
    </div>  
    <div class="cell">
      <div class="cell-content">2026</div>
    </div>  
    <div class="cell">
      <div class="cell-content">2027</div>
    </div> 
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0