zoukankan      html  css  js  c++  java
  • JQuery基础学习(三) 实现淡入淡出效果

    其实淡入淡出效果也是很简单的,直接上代码吧,权当做个笔记。

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>淡入淡出</title>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function ShowMessage(str)
        {
            alert(str);
        }
        function fadeOutClick()
        {
            $("#div1").fadeOut();
            $("#div2").fadeOut("slow");
            $("#div3").fadeOut(3000,ShowMessage("成功淡出"));
        }
        function fadeInClick()
        {
            $("#div1").fadeIn();
            $("#div2").fadeIn("slow");
            $("#div3").fadeIn(3000, ShowMessage("成功淡入"));
        }
    </script>
    </head>
    
    <body>
        <p>演示带有不同参数的 fadeOut() 方法。</p>
        <button onclick="fadeOutClick()">点击这里,使三个矩形淡出</button>
        <br/><br/>
        <button onclick="fadeInClick()">点击这里,使三个矩形淡入</button>
        <br/>
        <div id="div1" style="80px;height:80px;background-color:red;"></div>
        <br/>
        <div id="div2" style="80px;height:80px;background-color:green;"></div>
        <br/>
        <div id="div3" style="80px;height:80px;background-color:blue;"></div>
    </body>
    </html>
  • 相关阅读:
    java8学习之Optional深入详解
    java8学习之Supplier与函数式接口总结
    java8学习之Predicate深入剖析与函数式编程本质
    conda
    matplotlib-折线图、散点图
    欧盟GDPR通用数据保护条例-原文
    python装饰器的应用案例
    python练习汇总
    python分段算利润、税收
    需求-shidebing
  • 原文地址:https://www.cnblogs.com/FirstCode/p/2937254.html
Copyright © 2011-2022 走看看