jquery的事件没有on,js的有。

jquey动画效果

 

 1、show()  显示  由小变大缓慢显示

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>魔降风云变</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background-color: red;
            display: none;
        }
    </style>
</head>
<body>
    <button id="btn">动画</button>
    <div id="box"></div>
    <script type="text/javascript" src="js/jquery.js" charset="utf-8"></script>
    <script type="text/javascript">
        $('#btn').click(function () {
            $('#box').show()
        })
    </script>
</body>
</html>

按钮.click事件。默认不显示的内容.show(),显示出来

一开始是没有的:

jquey动画效果

点击一下就出现了。

 jquey动画效果

show中可以添加毫秒,1000毫秒是一秒。由小变大缓慢显示

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>魔降风云变</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background-color: red;
            display: none;
        }
    </style>
</head>
<body>
    <button id="btn">动画</button>
    <div id="box"></div>
    <script type="text/javascript" src="js/jquery.js" charset="utf-8"></script>
    <script type="text/javascript">
        $('#btn').click(function () {
            $('#box').show(2000)
        })
    </script>
</body>
</html>
View Code

相关文章:

  • 2018-10-13
  • 2021-12-25
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-08-14
  • 2021-08-19
猜你喜欢
  • 2021-09-22
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案