jQuery学习之淡出淡入
2015-09-12 23:11
721 查看
<!DOCTYPE html> <!--淡出淡入:实质上就是jquery的动画效果的一种 主要的函数有: fadeIn()淡入已隐藏的元素 fadeOut()淡出可见元素 fadeToggle()淡出淡入任意切换 fadeTo()许渐变为给定的不透明度(值介于 0 与 1 之间) --> <html> <head lang="en"> <meta charset="UTF-8"> <title>jQuery淡出淡入</title> <script src="../res/jquery-1.10.2.min.js"></script> <script type="text/javascript"> $(function(){ $("#button").click(function(){ $("#div1").fadeIn(); $("#div2").fadeIn("slow"); $("#div3").fadeIn(3000); }); $("#button1").click(function(){ $("#div1").fadeOut(); $("#div2").fadeOut("slow"); $("#div3").fadeOut(3000); }); $("#button2").click(function(){ $("#div7").fadeToggle(); $("#div8").fadeToggle("slow"); $("#div9").fadeToggle(3000); }); }); </script> </head> <body> <p style="content: close-quote">演示带有不同参数的淡出淡入方法。</p> <button id="button">点击这里fadeIn</button> <br><br> <div id="div1" style="width:80px;height:80px;display:none;background-color:red;"></div> <br> <div id="div2" style="width:80px;height:80px;display:none;background-color:green;"></div> <br> <div id="div3" style="width:80px;height:80px;display:none;background-color:blue;"></div> <button id="button1">点击这里fadeOut</button> <br><br> <!--<div id="div4" style="width:80px;height:80px;display:none;background-color:red;"></div> <br> <div id="div5" style="width:80px;height:80px;display:none;background-color:green;"></div> <br> <div id="div6" style="width:80px;height:80px;display:none;background-color:blue;"></div>--> <button id="button2">点击这里fadeToggle</button> <br><br> <div id="div7" style="width:80px;height:80px;display:none;background-color:red;"></div> <br> <div id="div8" style="width:80px;height:80px;display:none;background-color:green;"></div> <br> <div id="div9" style="width:80px;height:80px;display:none;background-color:blue;"></div> </body> </html>
相关文章推荐
- jQuery中jqGrid分页实现代码
- jquery 选择器(name,属性,元素)大全
- jQuery学习之基本选择器
- 锋利的Jquery【读书笔记】 -- 第一章
- Jquery-easyUI-datagrid参数之 queryParams
- jquery根据id取不到textarea对象,无法给textarea赋值
- j2ee学习笔记之前端(js、jQuery、html、html5、webService、ajax、css)—— 一直会补充
- JavaScript学习笔记8-jQuery基本过滤选择器深度解析
- jQuery常用Event-API
- jQuery 中 attr() 和 prop() 方法的区别
- jQuery使用ajax跨域获取数据
- jQuery常用Method-API
- jQuery中的九类选择器
- jQuery判断checkbox是否选中
- 【转】js/jquery中刷新iframe方法(兼容主流)
- jquery treeview(树状菜单) 插件参数说明
- 利用jquery each方法遍历<span>内容
- jquery validation验证身份证号、护照、电话号码、email
- jQuery二级联动动态列表
- Jquery中的$().each,$.each的区别