jQuery Custom PopUp Window
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Demo for jQuery Custom PopUp Window</title>
<style type="text/css">
/*Geovin Du: Style you custom popupbox according to your requirement */
.popupbox {
width:500px;
height:300px;
background-image:url(images/pop-up_03.png);
background-repeat:no-repeat;
display: none; /* Hidden as default */
float: left;
position: fixed;
top: 50%; left: 50%;
z-index: 99999;
-webkit-box-shadow: 0px 0px 20px #000;
-moz-box-shadow: 0px 0px 20px #000;
box-shadow: 0px 0px 20px #000;
}
.popupbox2 {
width:454px;
height:307px;
background-image:url(images/pu_03.png);
background-repeat:no-repeat;
display: none;
float: left;
position: fixed;
top: 50%; left: 50%;
z-index: 99999;
-webkit-box-shadow: 0px 0px 20px #000;
-moz-box-shadow: 0px 0px 20px #000;
box-shadow: 0px 0px 20px #000;
}
.popupbox3 {
width:502px;
height:302px;
background-image:url(images/3_03.png);
background-repeat:no-repeat;
display: none;
float: left;
position: fixed;
top: 50%; left: 50%;
z-index: 99999;
-webkit-box-shadow: 0px 0px 20px #000;
-moz-box-shadow: 0px 0px 20px #000;
box-shadow: 0px 0px 20px #000;
}
#fade {
display: none; /* Hidden as default */
background: #000;
position: fixed; left: 0; top: 0;
width: 100%; height: 100%;
opacity: .80;
z-index: 9999;
}
#intabdiv {
text-align:center;
}
#intabdiv {
padding:30px 30px 30px 30px;
} #intabdiv2 {
padding:70px;
}
#intabdiv2 h2 {
font-size:24px;
color:#696868;
font-family:Verdana, Geneva, sans-serif;
}
#intabdiv2 p {
font-size:12px;
color:#696868;
font-family:Verdana, Geneva, sans-serif;
line-height:20px;
} #intabdiv3 {
padding:70px;
}
#intabdiv3 h2 {
font-size:24px;
color:#fff;
font-family:Verdana, Geneva, sans-serif;
}
#intabdiv3 p {
font-size:12px;
color:#fff;
font-family:Verdana, Geneva, sans-serif;
line-height:20px;
}
#closeThis
{
margin-right:0px;
float:right;
padding-right:10px;
padding-top:5px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
//http://www.htmldrive.net/categorys/show/12/Lightbox-Dialog-Overlay
$(document).ready(function() { // Here we will write a function when link click under class popup
$('a.popup').click(function() { // Here we will describe a variable popupid which gets the
// rel attribute from the clicked link
var popupid = $(this).attr('rel'); // Now we need to popup the marked which belongs to the rel attribute
// Suppose the rel attribute of click link is popuprel then here in below code
// #popuprel will fadein
$('#' + popupid).fadeIn(); // append div with id fade into the bottom of body tag
// and we allready styled it in our step 2 : CSS
$('body').append('<div id="fade"></div>');
$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); // Now here we need to have our popup box in center of
// webpage when its fadein. so we add 10px to height and width
var popuptopmargin = ($('#' + popupid).height() + 10) / 2;
var popupleftmargin = ($('#' + popupid).width() + 10) / 2; // Then using .css function style our popup box for center allignment
$('#' + popupid).css({
'margin-top' : -popuptopmargin,
'margin-left' : -popupleftmargin
});
}); // Now define one more function which is used to fadeout the
// fade layer and popup window as soon as we click on fade layer
//關閉層,塗聚文修改 20130813
$("div a.closeThis").click(function(){
$(this).parent().hide();
$('#fade , #popuprel , #popuprel2 , #popuprel3').fadeOut()
return false;
}); $('#fade').click(function() {
// Add markup ids of all custom popup box here
$('#fade , #popuprel , #popuprel2 , #popuprel3').fadeOut()
return false;
});
});
</script>
<script type="text/javascript"> $(document).ready( function(){}); function hiden(){ $("#divObj").hide();//hide()函数,实现隐藏,括号里还可以带一个时间参数(毫秒)例如hide(2000)以2000毫秒的速度隐藏,还可以带slow,fast } function slideToggle(){ $("#divObj").slideToggle(2000);//窗帘效果的切换,点一下收,点一下开,参数可以无,参数说明同上 } function show(){ $("#divObj").show();//显示,参数说明同上 } function toggle(){ $("#divObj").toggle(2000);//显示隐藏切换,参数可以无,参数说明同上 } function slide(){ $("#divObj").slideDown();//窗帘效果展开 } </script>
</head> <body> <h3>div里内容的显示隐藏特效</h3> <input type="button" value="隐藏" onclick="hiden()"/>
<input type="button" value="显示" onclick="show()"/>
<input type="button" value="窗帘效果显示2" onclick="slide()"/>
<input type="button" value="窗帘效果的切换" onclick="slideToggle()"/>
<input type="button" value="隐藏显示效果切换" onclick="toggle()"/> <div id="divObj" style="display:none">
1.测试例子<br/>
2.测试例子<br/>
3.测试例子<br/>
4.测试例子<br/>
5.测试例子<br/>
6.测试例子<br/>
7.测试例子<br/>
8.测试例子<br/>
9.测试例子<br/>
0.测试例子<br/>
</div> <h1><a href="#" rel="popuprel" class="popup">Click Here for 1st Custom Modal Window</a></h1>
<h1><a href="#" rel="popuprel2" class="popup">Click Here for 2nd Custom Modal Window</a></h1>
<h1><a href="#" rel="popuprel3" class="popup">Click Here for 3rd Custom Modal Window</a></h1> <div class="popupbox" id="popuprel"><a href="#" class="closeThis" id="closeThis"><img src="data:images/close_pop.png" alt=""/></a>
<div id="intabdiv">
<h2>天下為公 </h2>
<p> why we only heard about haves and have-nots,why we didn't heard about doers and doer-nots.人生是一种心境,生活是一种艺术,成功是一种心态,幸福是一种感觉,竞争是一种建构,情感是一种整合.学习是一种成长.逻辑和美都关注封闭的事实,我们的生活则是发现的经验中度过的.....$经一番挫折,长一番识见.容一番横逆,增一番器度.省一番经营,多一分道义.学一分退让,讨一分便宜.去一分奢侈,少一分罪过.加一分体贴,知一分物情</p> </div> </div> <div class="popupbox2" id="popuprel2"><a href="#" class="closeThis" id="closeThis"><img src="data:images/close_pop.png" alt=""/></a>
<div id="intabdiv2">
<h2>塗聚文</h2>
<p> 哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构(分析)整合学习, 情商(EQ)运筹(学)成功,信息流,物流,人力资源流,资本流的系统解决方案的开发与设计.</p> </div> </div> <div class="popupbox3" id="popuprel3"><a href="#" class="closeThis" id="closeThis"><img src="data:images/close_pop.png" alt=""/></a>
<div id="intabdiv3">
<h2>捷為工作室</h2>
<p>£捡垃圾,就是我的一生渴求. £并且喜欢这句"书中自有黄金屋,书中自有颜如玉,书中自有千钟黍,书中车马多簇簇"的感慨."读书长见识,行路广阅历",是一个"悟"字. $自然是我最想追求的"偶像". ¥读者是,读之者,者之读.一沙一世界! ¥to be is to do举世皆清我独浊,众人皆醒我独醉</p> </div>
</div> <div id="fade"></div>
</body> </html>
jQuery Custom PopUp Window的更多相关文章
- Error when clicking other button after displaying Popup window(转)
原文地址:Error when clicking other button after displaying Popup window Hi, I'm developing a custom page ...
- jQuery Ready 与 Window onload 的区别(转)
“我们都知道,很多时候,在页面加载完后都需要做一些相应的初始化动作.例如,运行某些js特效,设置表单等等.怎么知道页面加载完了呢?一 般情况下都是设置body标签的onload监听window的loa ...
- 在指定控件位置弹出popup window
先看效果图 黄色的就是弹出的popup window 首先自定义一个view用来显示,文件名为layout_my_view.xml <?xml version="1.0" e ...
- Pass value from child popup window to parent page window using JavaScript--reference
Here Mudassar Ahmed Khan has explained how to pass value from child popup window to parent page wind ...
- 设计Popup Window
设计一个Popup window, 在其中实现分享到Facebook 和Twitter 功能. popup window 名称为 ShareView.xaml, 代码如下: <phone:Pho ...
- 第二百零三节,jQuery EasyUI,Window(窗口)组件
jQuery EasyUI,Window(窗口)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 Window(窗口)组件的使用方法,这个组件 ...
- Add an Action that Displays a Pop-up Window 添加显示弹出窗口按钮
In this lesson, you will learn how to create an Action that shows a pop-up window. This type of Acti ...
- jquery自定义插件——window的实现
本例子实现弹窗的效果: 1.jquery.show.js /* * 开发者:lzugis * 开发时间:2014年6月10日 * 实现功能:点击在鼠标位置显示div * 版本序号:1.0 */ (fu ...
- Jquery Offset, Document, Window 都是什么
From http://www.cnblogs.com/luhe/archive/2012/11/14/2769263.html JQuery Offset实验与应用 我们有时候需要实现这样一种功 ...
随机推荐
- MyBatis与JDBC的对比
//JDBC的步骤,1.加载驱动.2.获取连接.3.执行sql语句.4.处理结果集.5.关闭资源 Class.forName("com.mysql.jdbc.Driver").ne ...
- Python3之json模块
概念: 序列化(Serialization):将对象的状态信息转换为可以存储或可以通过网络传输的过程,传输的格式可以是JSON,XML等.反序列化就是从存储区域(JSON,XML)读取反序列化对象的状 ...
- P2645 斯诺克 题解
P2645 斯诺克 题目背景 镇海中学开设了很多校本选修课程,有体育类.音乐类.美术类.无线电测向.航空航海航天模型制作等,力争使每位学生高中毕业后,能学到一门拿得出手的兴趣爱好,为将来的终身发展打下 ...
- SQl 根据某列去重 partition by
主键为ID select * from [infotops] where Id in (select max(id) from [infotops] group by InfoId) -------- ...
- CBoard 图表布局浅析
这两天想了解下图表布局,对前端Angular不熟悉,Java也不熟悉.只能靠经验摸索查找,所以把过程简单记录,生怕忘记.首先是打开图表,发现位置指向 /config/widget, 然后用IDEA搜索 ...
- 12C GI + 11g DB 环境中PSU安装
环境说明: 12.1.0.2的GI集群,11.2.0.4的RAC数据库,需要安装最新的补丁. 补丁下载: 12.1.0.2 GI的PSU:11.2.0.4 DB的PSU:OJVM For 11.2.0 ...
- α测试,Beta测试
α测试(内测)是由一个用户在开发环境下进行的测试,也可以是公司内部的用户在模拟实际操作环境下进行的测试.α测试的目的是评价软件产品的FLURPS(即功能.局域化.可使用性.可靠性.性能和支持).尤其注 ...
- 分享一个大型进销存供应链项目(多层架构、分布式WCF多服务器部署、微软企业库架构)
项目源码下载: WWW.DI81.COM 分享一个大型进销存供应链项目(多层架构.分布式WCF多服务器部署.微软企业库架构) 这是一个比较大型的项目,准备开源了.支持N家门店同时操作.远程WCF+企 ...
- Python-删除列表中重复元素的方法
1.set()方法 x = [1,2,3,4,5,1] y = list(set(x)) print(y) ``` [1, 2, 3, 4, 5] ``` 2. x = ['b','c','d','b ...
- 108th LeetCode Weekly Contest Binary Subarrays With Sum
In an array A of 0s and 1s, how many non-empty subarrays have sum S? Example 1: Input: A = [1,0,1,0, ...