Velocity.js V2触发fadeInDown而不是slideInDown

时间:2019-01-09 09:58:15

标签: javascript jquery velocity

Velocity.js V2动画存在一些问题,它会触发淡入淡出动画而不是下滑

FIDDLE

[代码段]

$(".trigger").click(function() {
  document.querySelectorAll(".dropdown").velocity("slideInDown", { duration: 500 } );
});

$(".trigger").click(function() {
  document.querySelectorAll(".dropdown").velocity("slideInDown", { duration: 500 } );
});
.trigger {
  padding:15px;
  border:2px solid grey;
  color:#000;
  cursor:pointer;
}

.dropdown {
   display:block;
   opacity:0;
   margin-top:20px;
   background-color:red;
   height:300px;
   width:300px;
   border:2px solid red;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/velocity-animate@2.0/velocity.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/velocity-animate@2.0/velocity.ui.min.js"></script>


<button class="trigger">
Click 
</button>
<div class="dropdown">
DropDown Content
</div>

任何帮助将不胜感激

0 个答案:

没有答案