jqurey 2
2015-08-19 09:25
155 查看
1.
$("#test").hide(); //jQuery 的 hide() 函数,隐藏 id="test" 的元素。
2.
$(".test").hide(); //jQuery 的 hide() 函数,隐藏所有 class="test" 的元素。
3.
$("#div1").fadeOut(); //jQuery fadeout() 函数,淡出
$("#div2").fadeOut("slow");
$("#div3").fadeOut(1000);
4.
$("p").click(function(){ //“<p>点击我,我会消失</p>”点击会消失
$(this).hide();
});
5.//一个css样式
<style type="text/css">
div.ex
{
background-color:#e5eecc;
padding:7px;
border:solid 1px #c3c3c3;
}
</style>
<div class="ex">
<p>联系人:张先生<br />
</div>
$("#test").hide(); //jQuery 的 hide() 函数,隐藏 id="test" 的元素。
2.
$(".test").hide(); //jQuery 的 hide() 函数,隐藏所有 class="test" 的元素。
3.
$("#div1").fadeOut(); //jQuery fadeout() 函数,淡出
$("#div2").fadeOut("slow");
$("#div3").fadeOut(1000);
4.
$("p").click(function(){ //“<p>点击我,我会消失</p>”点击会消失
$(this).hide();
});
5.//一个css样式
<style type="text/css">
div.ex
{
background-color:#e5eecc;
padding:7px;
border:solid 1px #c3c3c3;
}
</style>
<div class="ex">
<p>联系人:张先生<br />
</div>
相关文章推荐
- Android Native 绘图方法
- C#实现将数组内元素打乱顺序的方法
- firefox下rowspan+border+border-collapse的bug
- css下margin、padding、border、background和font缩写示例
- DIV border边框显示不完全问题的解决方法
- jQuery删除一个元素后淡出效果展示删除过程的方法
- Perl中怎样从数组中删除某个值?
- javascript 面向对象编程 function是方法(函数)
- javascript 面向对象编程 function也是类
- IIS下PHP连接数据库提示mysql undefined function mysql_connect()
- javascript学习笔记(十八) 获得页面中的元素代码
- javascript实现在某个元素上阻止鼠标右键事件的方法和实例
- jQuery验证元素是否为空的两种常用方法
- JavaScript通过function定义对象并给对象添加toString()方法实例分析
- IE 当eval遇上function的处理
- JavaScript中Object和Function的关系小结
- Javascript 使用function定义构造函数
- javascript Object与Function使用
- javascript下function声明一些小结
- 常用的javascript function代码