GreyBox是一个遮罩层的组件也称模式窗口或模态窗口(所谓模态窗口,就是指除非采取有效的关闭手段,用户的鼠标焦点或者输入光标将一直停留在其上的窗口),它运行以后可以产生不错的界面。类似于thinkbox,lightbox等。用于以一种别致的模式对话框方式展示页面,图片或者其它内容。这是它的官网:http://orangoo.com/labs/GreyBox/
- <script type="text/javascript">
- //设置greybox的根目录
- var GB_ROOT_DIR = "./greybox/";
- </script>
- <script type="text/javascript" src="greybox/AJS.js"></script>
- <script type="text/javascript" src="greybox/AJS_fx.js"></script>
- <script type="text/javascript" src="greybox/gb_scripts.js"></script>
- <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" />
第三步:实现功能:
- <%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
- <!—必须添加dtd-->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
- <head>
- <title>My JSP 'index.jsp' starting page</title>
- <script type="text/javascript">
- //设置greybox的根目录
- var GB_ROOT_DIR = "./greybox/";
- </script>
- <script type="text/javascript" src="greybox/AJS.js"></script>
- <script type="text/javascript" src="greybox/AJS_fx.js"></script>
- <script type="text/javascript" src="greybox/gb_scripts.js"></script>
- <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript">
- function login(){
- //GB_showCenter(caption, url, /* optional */ height, width, callback_fn)
- GB_showCenter("用户登录","/greybox/login.jsp",200,300,show);
- }
- function show(){ alert("关闭");}
- </script>
- </head>
- <body>
- <a href="javascript:login()">登陆</a>
- <script type="text/javascript">
- for(var i=1;i<16;i++){
- var str="<a href='p_w_picpath/"+i+".gif' rel='gb_p_w_picpathset[p_w_picpath]' title=''><img src='p_w_picpath/"
- +i+".gif' border='0'/></a>"
- document.write(str);
- if(i%6==0){document.writeln("<br>"); }
- }
- </script>
- </body></html>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。