<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> div#result{ width:400px; height:400px; background-color:red; } </style> <script src="js/jquery.js"></script> <script> $(function(){ $(‘#btnslideDown‘).bind(‘click‘,function(){ $(‘#result‘).slideDown(3000); }); $(‘#btnslideUp‘).bind(‘click‘,function(){ $(‘#result‘).slideUp(3000,function(){ alert(‘滑动已完事‘); }); }); $(‘#btnslideToggle‘).bind(‘click‘,function(){ $(‘#result‘).slideToggle(3000); }); }); </script> </head> <body> <div id="result"></div> <hr /> <input type="button" id="btnslideDown" value="SlideDown" /> <input type="button" id="btnslideUp" value="SlideUp" /> <input type="button" id="btnslideToggle" value="SlideToggle" /> </body> </html>
时间: 2024-10-29 19:11:55