推介:| 調解員課程 | Makeup Course | Hypnosis course | English course | NLP training | cissp cisa cism | 營養學課程 |

發新話題
打印

[原創] HTML实现网页放大镜

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>

TOP

thx~!!!!!!!!!!!!!!!!

TOP

發新話題


重要聲明:本討論區是以即時上載留言的方式運作,本網站對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。本討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。


Copyright 1997- Xocat. All Right Reserved.