.fadeToggle()
Run
↔
<!doctype html> <html lang="vi"> <head> <meta charset="utf-8"> <title>Học web chuẩn</title> <script src="https://code.jquery.com/jquery-latest.js"></script> <style> div { background-color: blue; float: left; margin-right: 20px; height: 100px; width: 150px; } p { clear: both; } </style> <script> $(function(){ $('button').click(function() { $('.test01').fadeToggle(800); $('.test02').fadeToggle('fast'); }); }); </script> </head> <body> <p><button>Toggle</button></p> <div class="test01">Fade Toggle 800</div> <div class="test02">Fade Toggle fast</div> </body> </html>