Chinaunix首页 | 论坛 | 博客
  • 博客访问: 331846
  • 博文数量: 31
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1134
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-25 09:41
个人简介

目前任职于搜狐~

文章分类

全部博文(31)

文章存档

2014年(12)

2013年(19)

分类: Html/Css

2013-10-12 22:59:37


1、首先是JSP文件 index.jsp

点击(此处)折叠或打开

  1. <%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  3. <html>
  4.   <head>
  5.     <link href="global.css" rel="stylesheet" type="text/css" />
  6.     <script type="text/javascript" src="jquery-1.4.2.js"></script>
  7.   </head>
  8.   
  9.   <script type="text/javascript">
  10.       //显示加载效果
  11.     function showPopDiv(){
  12.         $("#loading").css("display","block");
  13.         $("#popDiv").css("display","block");
  14.     }
  15.     //取消加载效果
  16.     function hiddenPopDiv(){
  17.         $("#loading").css("display","none");
  18.         $("#popDiv").css("display","none");
  19.     }
  20.     </script>
  21.   <body>
  22.     <input type="button" value="显示加载" onclick="showPopDiv();"/>
  23.     <div id="popDiv"></div>
  24.     <div id="loading"></div>
  25.     <input type="button" value="取消加载" onclick="hiddenPopDiv();"/>
  26.   </body>
  27. </html>

2、css文件 global.css

点击(此处)折叠或打开

  1. #loading{
  2.     position:fixed;_position:absolute;
  3.     display: none;
  4.     top:50%;left:50%;
  5.     width:124px;height:124px;
  6.     overflow:hidden;
  7.     background:url(loaderc.gif) no-repeat;z-index:7;
  8.     margin:-62px 0 0 -62px;
  9.     }
  10.       
  11. #popDiv{
  12.     margin-top:50px;
  13.     display: none;
  14.     position: absolute;
  15.     top: 0%;
  16.     left: 0%;
  17.     width: 100%; height: 100%;
  18.     background-color: black;
  19.     z-index:2; -moz-opacity: 0.7;
  20.     opacity:.70;
  21.     filter: alpha(opacity=5);
  22. }
3、加载效果图片 loaderc.gif

    
4、在index.jsp中引入 jquery-1.4.2.js
    
阅读(3893) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~