jquery

关注公众号 jb51net

关闭
首页 > 网络编程 > JavaScript > javascript类库 > jquery > jQuery简单实现隐藏以及显示特效

jQuery简单实现隐藏以及显示特效

投稿:hebedich

这篇文章主要介绍了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>

效果很不错,代码也很简单,希望大家能够喜欢。

您可能感兴趣的文章:
阅读全文