jQuery中fadeIn、fadeOut、fadeTo的使用方法(图片显示与隐藏)
<head>
<title></title>
<styletype="text/css">
#img1
{
width:400px;height:500px;
}
</style>
<scriptsrc="jquery-1.9.1.js"type="text/javascript"></script>
<scripttype="text/javascript">
$(function(){
$("#Button1").bind("click",function(){
$("img").fadeOut(2000,function(){
$("#Button1").val("哎,没了"); //图片的消逝
});
})
$("#Button2").bind("click",function(){
$("img").fadeIn(2000,function(){
$("#Button2").val("有了"); //图片的呈现
});
})
$("#Button3").bind("click",function(){
$("img").fadeTo(2000,0.3,function(){
alert("画动执行终了"); //图片透明度
});
})
$("#Select1").bind("change",function(){//可是以change或者是click事件
$("img").fadeTo(1000,$("#Select1option:selected").val());
})
})
</script>
</head>
<body>
<imgsrc="images/1.jpg"id="img1"/>
<inputid="Button1"type="button"value="button"/>
<inputid="Button2"type="button"value="button"/>
<inputid="Button3"type="button"value="button"/>
<selectid="Select1">
<option>1</option>
<option>0.1</option>
<option>0.2</option>
<option>0.3</option>
<option>0.4</option>
<option>0.5</option>
<option>0.6</option>
<option>0.7</option>
<option>0.8</option>
<option>0.9</option>
<option>0</option>
</select>
</body>
相关文章
- jQuery Google Charts—-一个封装google chart api的jquery插件详解编程语言
- jquery trigger使用方法详解编程语言
- jQuery after()和insertAfter()方法
- jquery里的each使用方法详解
- jQuery中使用了document和window哪些属性和方法小结
- JQuery入门——事件切换之hover()方法应用介绍
- ie下jquery.getJSON的缓存问题的处理方法
- jQuery布局插件UILayout简介及使用方法
- Jquery模板数据绑定插件的使用方法详解
- html5的自定义data-*属性和jquery的data()方法的使用示例
- 关于Jquery操作Cookie取值错误的解决方法
- Jquery的outerHeight方法使用介绍
- jQuery插件selectToSelect使用方法
- jquery中交替点击事件toggle方法的使用示例
- jquery中的on方法使用介绍
- jquery数组封装使用方法分享(jquery数组遍历)
- 使用jquery中height()方法获取各种高度大全
- 使用jQuery动态加载js脚本文件的方法
- jquery新的绑定事件机制on方法的使用方法
- JQuery动画animate的stop方法使用详解
- jQuery过滤方法filter()选择具有特殊属性的元素
- jquery获取html元素的绝对位置和相对位置的方法
- jquery操作对象数组元素方法详解
- Jquery弹出层插件ThickBox的使用方法
- jQuery调取jSon数据并展示的方法
- JQuery中使用Ajax赋值给全局变量失败异常的解决方法
- 使用JQuery库提供的扩展功能实现自定义方法