国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JQuery制作的放大效果的popup對話框(未添加任何jquery plugin)分享

2019-11-20 22:45:38
字體:
來源:轉載
供稿:網友
多的不說了,直奔主題,分享一個放大效果的popup dialog,項目中可以根據自己的需求來寫css,我打算復用到metro風格的site上去。

看起來動畫效果還是比較cool的,如果加上了處理后的效果更佳:
復制代碼 代碼如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<style>
body { background: #ace; font: 12px/1.2 Arial, Helvetica, sans-serif; }
ul li { background:#fff; margin:5px; width:100px; height:100px; float:left; }
#transition {
background:transparent;
display:none;
position:absolute; top:50%; left:50%; z-index:50;
z-index: 10001;
}
#content {
background:#fff;
border:1px solid #666;
margin:-50px 0 0 -50px;
width:100px; height:100px;
z-index: 10001;
}
#mask{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000000;
display: none;
z-index: 10000;
}
.close
{
width:30px;
height:20px;
background-color:Red;
cursor:pointer;
display:none;
}
.closeShow
{
width:30px;
height:20px;
margin-left:50px;
margin-top:-100px;
background-color:Red;
cursor:pointer;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('ul li').click(function (e) {
$("#mask").fadeTo(500, 0.25);
$("#content").html("<div>Loading....</div>");
var $t = $('#transition'),
to = $(this).offset();
var height = $(document).height();
var width = $(document).width();
$('#content').css({ width: 100, height: 100 });
$t.css({
top: to.top + 50,
left: to.left + 50,
display: 'block'
}).animate({
top: height / 2,
left: width / 2
}, 600, function () {
$(this).animate({
top: 125,
left: 175
}, 600);
$('#content').animate({
width: width * 0.8,
height: height * 0.8
}, 600, function () {
// open dialog here
$("#content").html("<div>Hello, please put content here.</div>");
});
});
});
$('#transition').click(function (e) {
$("#transition").hide();
$("#mask").hide();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<ul>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
<li>thumb</li>
</ul>
<div id='mask'></div>
<div id="transition"><div id="content">Loading....</div></div>
</form>
</body>
</html>

加入了mask效果,如果不需要可以直接刪掉。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 商丘市| 平江县| 新蔡县| 枣阳市| 时尚| 瑞安市| 巴林左旗| 防城港市| 河北区| 新竹县| 建瓯市| 湖南省| 石景山区| 赤峰市| 富锦市| 马公市| 博白县| 霞浦县| 南涧| 封开县| 海原县| 出国| 敦化市| 军事| 承德县| 连城县| 黎城县| 射阳县| 淄博市| 平阴县| 边坝县| 东光县| 双桥区| 惠水县| 阿图什市| 那坡县| 大关县| 外汇| 外汇| 炉霍县| 温泉县|