我怎样才能为轻松进行动画制作

时间:2018-06-07 07:00:07

标签: jquery smooth-scrolling

我的页面上有一个平滑的滚动,但我希望它可以轻松实现。有东西吗?

这是我的代码的一部分。

idB integer FOREIGN KEY REFERENCES exam.RelationAandB CASCADE DELETE,

1 个答案:

答案 0 :(得分:1)

jQuery有非常基本的动画。您需要另外加载jQuery UI以获得esea-in-out动画。



$(document).on('click', '#sample', function () {
  $(this)
    .animate(
      {height: "hide"},
      2000,
      'easeInOutQuint'
    )
    .delay(800)
    .animate(
      {height: "show"},
      2000,
      'easeInOutQuint'
    );
});

#sample {
  width: 100px;
  height: 100px;
  background-color: black;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<div id="sample"></div>
&#13;
&#13;
&#13;

相关问题