jquery的toggle动画效果显示隐藏
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> div{ border: 1px solid white; width: 500px; height: 350px; margin: auto; text-align: center; } </style> <script type="text/javascript" src="../js/jquery-1.8.3.js"> </script> <script type="text/javascript"> $(function(){ $("#btn").click(function(){ $("#img1").toggle(); }); }); </script> </head> <body> <div> <input type="button" name="btn" id="btn" value="显示/隐藏" /> <img src="../img/飞机05.gif" width="100%" height="100%" id="img1"/> </div> </body> </html>