摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery自定義動(dòng)畫(huà)</title> &nbs
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery自定義動(dòng)畫(huà)</title> <style type="text/css"> div{ width: 200px; height: 200px; background: red; border: 5px #000; position: absolute; } </style> <script src="jquery-3.3.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('.but1').click(function(){ $('p').animate({fontSize:'40px'},1500)//屬性名稱(chēng)一律改成駝峰寫(xiě)法 }) //同時(shí)操作多個(gè)css屬性 //使用預(yù)定義的值show hide toggle $('.but2').click(function(){ $('div').animate({ // left:'400px', // opacity:'0.3', // height:'400px', // width:'400px' width:'toggle', height:'toggle' },1500) }) }) </script> </head> <body> <button class="but1">字體放大按柳</button> <p>jQuery中我們使用animate()方法創(chuàng)建自定義的動(dòng)畫(huà)</p> <button class="but1">改變div按柳</button> <div></div> </body> </html>
怎么Sublime復(fù)制過(guò)來(lái)button里的class就不見(jiàn)了呢