<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jq之demo</title> <!--线上jq库--> <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ /*变淡*/ $("#div1").fadeTo(); $("#div2").fadeTo("slow",0.7); $("#div3").fadeTo("slow",0.3); }); }); </script> </head> <body> <p>test</p> <button>点击</button> <br/> <div id="div1" style="width:80px;height:30px;background-color: red;"></div> <div id="div2" style="width:90px;height:30px;background-color: blue;"></div> <div id="div3" style="width:1000px;height:30px;background-color: yellow;"></div> </body> </html>
jq之fadeTo
最新推荐文章于 2022-07-22 10:25:29 发布