编辑下面的代码:【加编码】
<html lang="en"> <head> <meta charset="utf-8"> <title>.addClass() 演示</title> <link rel="stylesheet" href="https://libs.baidu.com/jqueryui/1.10.4/css/jquery-ui.min.css"> <style> div { width: 100px; height: 100px; background-color: #ccc; } .big-blue { width: 200px; height: 200px; background-color: #00f; } </style> <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <script src="https://libs.baidu.com/jqueryui/1.10.4/jquery-ui.min.js"></script> </head> <body> <div></div> <script> $( "div" ).click(function() { $( this ).addClass( "big-blue", 1000, "easeOutBounce" ); }); </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂