abstrakt:<!DOCTYPE html><html><head> <title></title> <script type="text/javascript" src="jquery-3.3.1.js"></script> <style type="text/css&q
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="jquery-3.3.1.js"></script> <style type="text/css"> div{ height: 200px; width: 200px; background: blue; position: absolute; } </style> <script type="text/javascript"> $(document).ready(function(){ $('#bt1').click(function(){ $('p').animate({fontSize:"50px"},1500)//屬性名稱(chēng)font-size都寫(xiě)成駝峰寫(xiě)法fontSize }) $('#bt2').click(function(){ $('div').animate({//left:"500px" //opacity:0.3;//透明度 //height:300px //width:300px ////height:'toggle'; width:'toggle' },1500)//屬性名稱(chēng)font-size都寫(xiě)成駝峰寫(xiě)法fontSize }) }) </script> </head> <body> <button id="bt1">點(diǎn)擊字體放大</button> <p>jQuery中我們使用 animate()方法創(chuàng)建自定義的動(dòng)畫(huà)</p> <button id="bt2">點(diǎn)擊移動(dòng)div</button> <div></div> </body> </html>