TweenMax实现弹跳式下拉框美化效果代码

代码语言:html

所属分类:表单美化

代码描述:TweenMax实现弹跳式下拉框美化效果代码

代码标签: 下拉 美化 效果

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


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

<head>

  <meta charset="UTF-8">


  
  
<style>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300);
body {
  height: 100%;
  font-size: 16px;
  background: #1D77EF;
}

.select-ctr {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  width: 350px;
  height: 370px;
  font-family: "Roboto";
}
.select-ctr > div {
  padding: 15px 20px;
  position: absolute;
  width: 100%;
  font-size: 1.25rem;
  cursor: pointer;
}
.select-ctr .input-5 {
  top: 300px;
}
.select-ctr .input-4 {
  top: 240px;
}
.select-ctr .input-3 {
  top: 180px;
}
.select-ctr .input-2 {
  top: 120px;
}
.select-ctr .input-1 {
  top: 60px;
}
.select-ctr > div.input {
  background: #fff;
  color: #777;
  border-radius: 2px;
  box-shadow: 0 2px 15px 3px rgba(0, 0, 0, 0.1);
}
.select-ctr > div.input.active {
  color: #1D77EF;
}
.select-ctr > div.input-preview {
  color: rgba(255, 255, 255, 0.75);
  position: relative;
  transition: 0.3s all ease;
}
.select-ctr > div.input-preview.active {
  color: white;
}
.select-ctr > div.input-preview:before {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  bottom: 20px;
  width: 20px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-clip-path: polygon(50% 73%, 0 0, 100% 0);
  clip-path: polygon(50% 73%, 0 0, 100% 0);
  padding: 10px;
  box-sizing: border-box;
  transition: 0.3s all ease;
}
.select-ctr > div.input-preview.active:before {
  background: white;
  -webkit-clip-path: polygon(50% 0, 0 73%, 100% 73%);
  clip-path: polygon(50% 0, 0 73%, 100% 73%);
}
</style>


</head>

<body>
  <div class='select-ctr'>
  <div class='selected-input input-preview'>What is your favourite pet?</div>
  <div class='input input-1' data-val='Cat'>Cat</div>
  <div class='input input-2' data-val='Dog'>Dog</div>
  <div class='input input-3' data-val='Birds'>Birds</div>
  <div class='input in.........完整代码请登录后点击上方下载按钮下载查看

网友评论0