<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./jQuery_1_4.js">
</script>
<script>
$(function(){
//动画速度
var speed = 2000;
//*******************************************
//弹出与收回 toggle
//*******************************************
//绑定事件处理
$("#btnShow").click(function(event){
if ($("#btnShow").attr("aa") == "out") {
$("#btnShow").attr("aa", "in");
$("#btnShow").html("收回文字");
}
else {
$("#btnShow").attr("aa", "out");
$("#btnShow").html("弹出文字");
}
//取消事件冒泡
event.stopPropagation();
//设置弹出层位置
var offset = $(event.target).offset();
$("#divPop").css({
top: offset.top + $(event.target).height() + "px",
left: offset.left
});
//切换弹出层的显示状态
$("#divPop").toggle(speed);
});
//*******************************************
//弹出,透明,消失 fadeTo
//*******************************************
$("#btnTm").click(function(event){
//设置弹出层的透明度
$("#divTm").fadeTo(0, 0.66);
//让弹出层透明显示
if ($("#divTm").css("display") == "none") {
$("#divTm").fadeIn(speed);
}
else {
$("#divTm").fadeOut(speed);
}
});
//*******************************************
//弹出,透明,消失 animate
//*******************************************
$("#btnTmani").click(function(event){
$("#divTmani").animate({
"opacity": 'toggle',
"top":$(window).height - $("#divTmani").height() - $("#divTmani").position().top
}, speed, function(){
//回调函数,隐藏div
$("#divTmani").hide();
});
});
//*******************************************
//逐渐变大 最后消失 animate
//*******************************************
$("#btnBig").click(function(){
$("#divBig").animate({
"opacity": "toggle",
"width": $(window).width() - 100,
"height": $(window).height() - 100
}, speed,function(){
//回调函数,隐藏div
$("#divBig").hide();
});
});
});
</script>
</head>
<body>
<div>
<br/>
<br/>
<br/>
<button id="btnShow" aa="out">
弹出文字
</button>
<button id="btnTm">
透明消失
</button>
<button id="btnTmani">
透明消失
</button>
<button id="btnBig">
变大消失
</button>
</div>
<!-- 弹出收回 -->
<div id="divPop" style="background-color: #f0f0f0;
border: solid 1px #000000;
position: absolute;
display:none;
width: 300px;
height: 100px;">
<div style="text-align: center;">
弹出收回
</div>
</div>
<!-- 透明消失 -->
<div id="divTm" style="background-color: #f0f0f0;
border: solid 1px #000000;
position: absolute;
display:none;
width: 300px;
height: 100px;">
<div style="text-align: center;">
透明消失
</div>
</div>
<!-- 透明消失 -->
<div id="divTmani" style="background-color: #f0f0f0;
border: solid 1px #000000;
position: absolute;
display:none;
width: 300px;
height: 100px;">
<div style="text-align: center;">
透明消失
</div>
</div>
<!-- 变大消失 -->
<div id="divBig" style="background-color: #f0f0f0;
border: solid 1px #000000;
position: absolute;
display:none;
width: 300px;
height: 100px;">
<div style="text-align: center;">
变大消失
</div>
</div>
</body>
</html>
分享到:
相关推荐
jquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-ui
jquery-ui-日期框扩展成时间框 jquery-ui时间框 基于别人的代码进行修改 jquery-ui-1.8.16.custom.css文件末尾加入以下代码 .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } .ui-timepicker-div dl{ ...
jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-...
这里包含jquery-ui-1.8.16.custom.min.js/jquery-ui-1.8.16.custom.css,我费了好长时间找到的,此东西可以配合jQuery UI开发指南一书使用。
jquery-ui-1.7.3.custom JQUERY UI
最新jquery-ui-1.11.2日期控件,官网下载内涵图片和自己添加的中文辅助jquery-ui-timepicker-zh-CN.js,经过本人测试绝对可以用,不知道怎么用的百度上找个例子即可,需要导入的包 ${ctx}/plugins/jquery-ui-1.11.2/...
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" /> 末尾加入以下代码 .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } .ui-timepicker-div dl{ text-...
jquery-ui-1.8.2.custom.min.js,jquery-ui-1.8.4.custom.css
最新的jqueryui jquery-ui-1.10.2.custom 包含jquery 1.9.1
jquery-ui-1.10.4.zip压缩包,jQuery官网所下资源,最新版本1.10.4
jquery-ui-1.9.2.custom.min.js
jquery-ui-1.8.18.custom
jquery-ui.css、jquery-ui.js
jquery-ui样式demo,非常实用,非常适合web开发
JQuery-UI-1.8 很好用的JQuery插件,通过调用可以减少很多代码量
jquery-ui.css
jquery-ui+jquery-ui-rails
呵呵,jquery-ui-1.7.1开发包!好就顶!
jquery-ui-1.8.18.custom包含所有jquery-ui所需的工具资料
jquery插件jquery-ui-1.8.18.custom.min.js