<!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的更多相关文章

  1. 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 ...

  2. jQuery Ready 与 Window onload 的区别(转)

    “我们都知道,很多时候,在页面加载完后都需要做一些相应的初始化动作.例如,运行某些js特效,设置表单等等.怎么知道页面加载完了呢?一 般情况下都是设置body标签的onload监听window的loa ...

  3. 在指定控件位置弹出popup window

    先看效果图 黄色的就是弹出的popup window 首先自定义一个view用来显示,文件名为layout_my_view.xml <?xml version="1.0" e ...

  4. 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 ...

  5. 设计Popup Window

    设计一个Popup window, 在其中实现分享到Facebook 和Twitter 功能. popup window 名称为 ShareView.xaml, 代码如下: <phone:Pho ...

  6. 第二百零三节,jQuery EasyUI,Window(窗口)组件

    jQuery EasyUI,Window(窗口)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 Window(窗口)组件的使用方法,这个组件 ...

  7. 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 ...

  8. jquery自定义插件——window的实现

    本例子实现弹窗的效果: 1.jquery.show.js /* * 开发者:lzugis * 开发时间:2014年6月10日 * 实现功能:点击在鼠标位置显示div * 版本序号:1.0 */ (fu ...

  9. Jquery Offset, Document, Window 都是什么

    From http://www.cnblogs.com/luhe/archive/2012/11/14/2769263.html   JQuery Offset实验与应用 我们有时候需要实现这样一种功 ...

随机推荐

  1. node创建一个简单的web服务

    本文将如何用node创建一个简单的web服务,过程也很简单呢~ 开始之前要先安装node.js 1.创建一个最简单的服务 // server.js const http = require('http ...

  2. 关于fatal error LINK1123:failure during conversion to COFF:file invalid or corrupt

    今天用Visual Studio 2010编译postgresql工程时突然遇到下面这个编译错误: fatal error LINK1123:failure during conversion to ...

  3. gym 102082B dp

    和51nod1055 一样: #include<iostream> #include<cstdio> #include<algorithm> #include< ...

  4. Navicat Premium 12破解激活

    下载Navicat Premium 12并安装: 蓝奏云下载:Navicat Premium 12注册机   链接:https://pan.baidu.com/s/1mN-urlh--SX1vbq7h ...

  5. 斐讯 N1 刷 Armbian 5.64

    前言 N1 天天链是斐讯出的一款挖矿产品,虽然已经翻车,但是本身硬件配置还是很不错的,晶晨 S905D 主控,蓝牙 4.1,双频 WiFi,2G + 8G,USB2.0,HDMI.而一个只要不到 80 ...

  6. 1076 Wifi密码 (15 分)

    // 思路是网上以一位大神的,特简单直接采用字符串,判断长度,还有最后一个元素是否T,便可通过ASCll输出数字:#include <iostream> #include <stri ...

  7. C++_类和动态内存分配2-改进后的String类

    添加前面介绍过的复制构造函数和赋值运算符,使类能够正确管理类对象使用的内存. 知道对象何时被创建和释放. =================================== 修订后的默认构造函数 ...

  8. C++_友元2-友元成员函数

    接着上一篇<友元是什么>中,我们发现Remote友元类的大多数方法都是用Tv类的公有接口实现.这意味着这些方法并不是真正需要友元. 事实上唯一直接访问Tv成员的Remote方法是Remot ...

  9. 1076 Wifi密码 (15 分)

    下面是微博上流传的一张照片:“各位亲爱的同学们,鉴于大家有时需要使用 wifi,又怕耽误亲们的学习,现将 wifi 密码设置为下列数学题答案:A-1:B-2:C-3:D-4:请同学们自己作答,每两日一 ...

  10. storm(2)-机制

     1.storm vs esper 2.storm vs spark streaming storm处理的是每次传入的一个事件:spark streaming 处理的是某个时间段窗口内的事件流. 因此 ...