jQuery简单实现隐藏以及显示特效
本文向大家介绍jQuery简单实现隐藏以及显示特效,包括了jQuery简单实现隐藏以及显示特效的使用技巧和注意事项,需要的朋友参考一下
简单的 隐藏以及显示的代码如下:
<!DOCTYPE html> <html> <head> <script src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#hide").click(function(){ $("p").hide(); }); $("#show").click(function(){ $("p").show(); }); }); </script> </head> <body> <p id="p1">如果点击“隐藏”按钮,我就会消失。</p> <button id="hide" type="button">隐藏</button> <button id="show" type="button">显示</button> </body> </html>
效果很不错,代码也很简单,希望大家能够喜欢。