jQuery ?? - ???
jQuery ??? ??
jQuery? ???? ??? ??? ??? ?? ? ????.
jQuery?? ?? ? ?? ??? ???? ????.
fadeIn()
fadeOut()
fadeToggle()
fadeTo()
fadeIn() ???
jQuery fadeIn()? ??? ?? ?????. ??? ??.
??:
$(selector).fadeIn(speed,callback);
???? ?? ????? ??? ?? ??? ?????. "??", "??" ?? ??? ?? ??? ? ????. .
???? ?? ????? ???? ??? ? ??? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeIn(); $("#div2").fadeIn("slow"); $("#div3").fadeIn(4000); }); }); </script> </head> <body> <button>點擊淡入</button> <br><br> <div id="div1" style="width:80px;height:80px;display:none;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;display:none;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;display:none;background-color:blue;"></div> </body> </html>
fadeOut() ???
jQuery fadeOut() ???? ??? ??? ??? ???? ? ?????.
??:
$(selector).fadeOut(speed,callback);
???? ?? ????? ??? ?? ??? ?????. "??", "??" ?? ??? ?? ??? ? ????.
???? ?? ????? ???? ??? ? ??? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeOut(); $("#div2").fadeOut("slow"); $("#div3").fadeOut(5000); }); }); </script> </head> <body> <button>點擊淡出</button> <br><br> <div id="div1" style="width:80px;height:80px;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;background-color:blue;"></div> </body> </html>
fadeOut() ???
jQuery fadeOut() ???? ??? ??? ??? ???? ? ?????.
??:
$(selector).fadeOut(speed,callback);
???? ?? ????? ??? ?? ??? ?????. "??", "??" ?? ??? ?? ??? ? ????.
???? ?? ????? ???? ??? ? ??? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeOut(); $("#div2").fadeOut("slow"); $("#div3").fadeOut(4000); }); }); </script> </head> <body> <button>點擊淡出</button> <br><br> <div id="div1" style="width:80px;height:80px;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;background-color:blue;"></div> </body> </html>
fadeToggle() ???
jQuery fadeToggle() ???? fadeIn()? fadeOut() ??? ??? ??? ? ????.
fadeToggle()? ?? ??? ??? ??? ??? ? ??? ?????.
fadeToggle()? ?? ??? ?? ??? ??? ?? ??? ?????.
??:
$(selector).fadeToggle(speed,callback);
???? ?? ????? ??? ?? ??? ?????. "??", "??" ?? ??? ?? ??? ? ????.
???? ?? ????? ???? ??? ? ??? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeToggle(1000); $("#div2").fadeToggle("slow"); $("#div3").fadeToggle(4000); }); }); </script> </head> <body> <button>點擊淡入/淡出</button> <br><br> <div id="div1" style="width:80px;height:80px;background-color:red;"></div> <br> <div id="div2" style="width:80px;height:80px;background-color:green;"></div> <br> <div id="div3" style="width:80px;height:80px;background-color:blue;"></div> </body> </html>