zoukankan      html  css  js  c++  java
  • jquery淡入淡出无延迟代码

    <!DOCTYPE html>
    
    <html>
    
    <head>
    
    <script src="jquery.js"></script>
    
    <script>
    
    $(document).ready(function(){
    
      $("#button1").mouseover(function(){
    
           $(".div1").stop().animate({opacity:1},1000);
    
        $(".div2").stop().animate({opacity:1},1000);
    
        $(".div3").stop().animate({opacity:1},1000);
    
      });
    
     
    
      $("#button1").mouseleave(function(){
    
           $(".div1").stop().animate({opacity:0},1000);
    
        $(".div2").stop().animate({opacity:0},1000);
    
        $(".div3").stop().animate({opacity:0},1000);
    
      });
    
     
    
    });
    
    </script>
    
    </head>
    
     
    
    <body>
    
    <button id="button1">鼠标放在这里,使三个矩形淡入</button>
    
     
    
    <div class="div1" style="80px;height:80px;opacity:0;background-color:red;"></div>
    
    <br>
    
     
    
    <div class="div2" style="80px;height:80px;opacity:0;background-color:green;"></div>
    
    <br>
    
     
    
    <div class="div3" style="80px;height:80px;opacity:0;background-color:blue;"></div>
    
    </body>
    
    </html>

    另外

    function () { $(".div1").animate({ 'opacity': 0 },{ queue: false, duration: 1000 }); },


    function () { $(".div1").animate({ 'opacity': 1 }, { queue: false, duration: 1000 }); } 

    也可以。

  • 相关阅读:
    【转载】分布式环境Raft一致性共识算法解读
    从码农到工程师:只要做到这6点
    产品思维的修炼–技术的必修课
    工具篇
    安全测试
    测试体会
    测试题目
    软件测试工具
    常见的性能测试方法
    性能测试在软件测试的周期位置
  • 原文地址:https://www.cnblogs.com/flying607/p/3495569.html
Copyright © 2011-2022 走看看