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

时间:2015-02-26    点击:109   

简单的 隐藏以及显示的代码如下:

复制代码 代码如下:

<!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>

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

JS仿Windows开机启动Loading进度条的方法
JS实现跟随鼠标闪烁转动色块的方法
javascript中typeof操作符和constucor属性检测
JS实现网页滚动条感应鼠标变色的方法
js随机生成网页背景颜色的方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved