分享一个JQuery制作的放大效果的popup对话框(未添加任何jquery plugin)
来源:互联网 发布:淘宝被骗款 怎么办 编辑:程序博客网 时间:2024/05/21 14:53
多的不说了,直奔主题,分享一个放大效果的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效果,如果不需要可以直接删掉。
- 分享一个JQuery制作的放大效果的popup对话框(未添加任何jquery plugin)
- 一个CSS+jQuery的放大缩小动画效果
- Jquery mobile 中用popup弹出对话框的实现
- 基于jQuery的图片放大效果
- jQuery 对话框 jQuery.plugin
- 利用jquery制作图片经过放大效果
- jquery 制作的表格效果
- jQuery的插件 --- 对话框的效果 (有遮罩效果)
- JQuery.fn.Popup 与 JQuery.Popup的区别
- jquery mobile 弹出对话框 popup
- jQuery实现的进度条效果(未测试)
- 一个非常棒的Jquery验证Plugin
- 如何写一个Jquery 的Plugin插件
- jquery的 一个常用 效果
- JQuery实现图片放大的动态菜单效果
- jQuery 鼠标悬停时放大图片的效果
- 编写Jquery的plugin
- 用jQuery制作Tab键的效果
- Android: 判断网络状态
- (收藏)经典的机器学习方面源代码库(非常全,数据挖掘,计算机视觉,模式识别,信息检索相关领域都适用的了)
- 开启php的征途
- Cocos2d-x 带冷却效果的菜单按钮CCMenuItem
- latex的宏包安装
- 分享一个JQuery制作的放大效果的popup对话框(未添加任何jquery plugin)
- 读书笔记: 状态机的简单实现
- 软工实验报告 ---虞邦瑞
- objective-c 中随机数的用法
- Linux进程间通信之共享内存+信号量
- C#与.NET4 高级程序设计 学习笔记 文章导航
- 下一阶段的开始
- 黑马程序员-------JAVA图文复习二
- 擎泰6211BA、6211BB主控U盘修复工具