JQuery实现的弹窗效果
来源:互联网 发布:淘宝账号怎么买 编辑:程序博客网 时间:2024/06/06 05:49
这是笔者实际项目中的一个需求,我们先来看看特效。
页面加载时弹出窗口,点击关闭按钮,窗口消失并呈现动画效果。
实现代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Web Project</title> <script type="text/javascript" src="js/jquery-1.5.min.js"></script> <style type="text/css"> #infobox{ position:absolute; width:480px; height:300px; border:#ccc solid 1px; z-index: 9999; } #infobox_header h1{ height:30px; font-size: 18px; margin-top:0px; line-height: 30px; text-align: center; background-image:url("image/header_bg.png"); } #infobox_header h1 #close_btn{ width: 15px; height: 15px; border:#ccc solid 1px; float: right; background-image: url("image/close.png"); margin-top:5px; margin-right:5px; cursor: pointer; } #noticeinfo{ width:440px; height:240px; margin-left: auto; margin-right:auto; } </style> </head> <body> <div id="infobox"> <div id="infobox_header"> <h1>公告信息<div id="close_btn"> </div></h1> </div> <div id="noticeinfo"> <p>重大通知,本行于端午节推出xxxx活动,活动内容xxxx,活动截至日期xxxx-xx-xx。</p> </div> </div> </body> <script type="text/javascript"> $("#infobox").hide(); $(document).ready(function(){ $("#infobox").slideDown(2000); }); $("#infobox").css({ "left":($(document).width() - 480) / 2, "top":($(document).height() - 300) / 2 }); $("#close_btn").click(function(){ //$("#infobox").fadeOut(2000); $("#infobox").hide(2000); }); $(window).resize(function(){ $("#infobox").css({ "left":($(document).width() - 480) / 2, "top":($(document).height() - 300) / 2 }); }); </script></html>
源码下载:http://download.csdn.net/detail/rongbo_j/8822805
图片资源可以从源码中获取。
0 0
- JQuery实现的弹窗效果
- jquery实现弹窗效果
- jquery实现弹窗效果
- jquery ui实现弹窗效果
- jquery实现弹窗效果实例
- jQuery实现的进度条效果
- jquery实现弹框效果
- jquery实现弹窗效果与表格中信息的添加
- jQuery实现的显示 隐藏效果
- Jquery中幻灯片效果的简单实现
- 基于jQuery实现的焦点轮换效果
- jquery实现股票的各种效果
- JQuery实现漂亮的滑动门效果
- jQuery实现很炫很酷的弹出层效果
- jQuery实现很炫很酷的弹出层效果
- jQuery实现的立体文字渐变效果
- JQuery+CSS实现的菜单效果
- jQuery实现动画效果的例子
- 【转载】LOG日志级别
- Android Service(二)
- JSON和XML解析
- Spring4.0+hibernate4.3报 No Session found for current thread
- POJ 1009 Edge Detection(图像边缘检测)
- JQuery实现的弹窗效果
- solr教程,值得刚接触搜索开发人员一看
- TCP/IP学习笔记(1)----------详解
- HTML5本地数据库(WebSQL)
- ORACLE日期时间函数大全
- Oracle 数据类型转换
- 屏幕适配
- 华为【oj】记负均正
- StretchPanel可以根据需要收缩或者展开视图的控件,使用简单方便!