TweenMax+Draggables实现拖拽刻度控制滚动条显示效果代码

代码语言:html

所属分类:拖放

代码描述:TweenMax+Draggables实现拖拽刻度控制滚动条显示效果代码

代码标签: TweenMax Draggables 拖拽 刻度 控制 滚动条 显示

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

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

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

  
  
  
<style>
body {
  font-family: 'Roboto', sans-serif;
  color: white;
}
#dragControl {
  width: 100px;
  height: 60px;
  position: relative;
  background: green;
  text-align: center;
  line-height: 60px;
  position: absolute;
}
#dragControl:after {
  position: absolute;
  content: '';
  width: 4px;
  height: 8px;
  left: 49px;
  top: -8px;
  background: green;
}

#dragBounds {
  width: 400px;
  height: 60px;
  background: black;
  margin: 50px auto;
  position: relative;
}

#stage {
  width: 600px;
  margin: 10px auto;
  height: 200px;
  background: #eee;
  position: relative;
  overflow: hidden;
}
.action {
  text-align: center;
  height: 100%;
  width: 100%;
  position: absolute;
}
.panelWrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.marker {
  position: absolute;
  width: 4px;
  height: 20px;
  background-color: black;
  top: -20px;
}
</style>

  
  
</head>

<body translate="no">
  <div id="dragBounds">
  <div id="dragControl">Drag</div>
</div>
<div id="stage">
  <div class="panelWrap"></div>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TweenMax.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/Draggable.1.20.3.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ThrowPropsPlugin.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
      <script  >
console.clear();
var panelCount = 13; // change to meet your needs

var panelStop = (panelCount-1)*2; 
// how m.........完整代码请登录后点击上方下载按钮下载查看

网友评论0