HTML实现网页放大镜
主页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'test1.jsp' starting page</title>
<meta http-equiv="pragma" c>
<meta http-equiv="cache-control" c>
<meta http-equiv="expires" c>
<meta http-equiv="keywords" c>
<meta http-equiv="description" c>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<SCRIPT>
//打开放大镜
function callDialog(fileName) {
showModelessDialog(fileName,window,
"status:false;dialogWidth:500px;dialogHeight:450px");
}
</SCRIPT>
</head>
<body>
<form Id="myform" name="myform" action="/user.do?method=queryPerUserInfo" >
<input type="text" name="test" size="20" readonly="readonly" />
<img src="webep/icon.gif" style="cursor:hand"
>
<input type="hidden" value="currPage" value="1">
</form>
</body>
</html>
放大镜页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'test2.jsp' starting page</title>
<meta http-equiv="pragma" c>
<meta http-equiv="cache-control" c>
<meta http-equiv="expires" c>
<meta http-equiv="keywords" c>
<meta http-equiv="description" c>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<!--这句话可以让模态子窗口提交给自己 -->
<base target="_self"/>
<script type="text/javascript">
function rewriteParentWin(strId)
{
<!--定位父窗口-->
var parentWin;
if (window.dialogArguments && dialogArguments.location)
{
parentWin = dialogArguments;
}
else
{
parentWin = opener;
}
//文本框内容
parentWin.document.myform.test.value = strId;
//焦点转移
parentWin.document.myform.test.focus();
//关闭当前窗口
window.close();
}
</script>
</head>
<body>
<form action="">
<INPUT value="选择" type=button >
</form>
</body>
</html>