由于本人积分不多了,有问题请各位大侠帮助。如有不明白的地方,请说。
第一个页面是父窗体页面
<%@page contentType='text/html;charset=UTF-8'%>
<%@page errorPage="/egp/error.jsp"%>
<%@page import="java.util.*"%>
<%@page import="com.cntaiping.egp.util.web.*"%>
<%@page import="com.cntaiping.egp.util.common.Tools"%>
<%@ page import="com.cntaiping.egp.util.db.ListPage"%>
<%@ page import="com.cntaiping.egp.system.login.EGPUser"%>
<%
String ctxPath = request.getContextPath();
DynaForm form = (DynaForm) request.getAttribute("dynaForm");
Map resultMap = (Map) request.getAttribute("resultMap");
if (resultMap == null) {
resultMap = new HashMap();
}
EGPUser user = (EGPUser) session.getAttribute("EGP_USER");
%>
<link type="text/css" href="<%=ctxPath%>/egp/js/jquery/jquery-ui.css" rel="stylesheet" />
<link type="text/css" href="<%=ctxPath%>/egp/js/jquery/plugins/borderlayout/jquery.layout.css" rel="stylesheet"/>
<script type="text/javascript" src="<%=ctxPath%>/egp/js/jquery/jquery.js"></script>
<script type="text/javascript" src="<%=ctxPath%>/egp/js/jquery/plugins/bgiframe/jquery.bgiframe.js"></script>
<script type="text/javascript" src="<%=ctxPath%>/egp/js/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="<%=ctxPath%>/egp/js/jquery/plugins/borderlayout/jquery.layout.js"></script>
<script type="text/javascript">
var myLayout; // a var is required because this page utilizes: myLayout.allowOverflow() method
$(document).ready(function () {
// Dialog
myDialog = $('#dialog').dialog({
autoOpen: false,
width: 750,
height:380,
draggable: true,
bgiframe: true,//dialog的select bug 被隐藏
resizable: true,
resizable: false, //dialog的大小不可以改变
draggable:false, //dialog不可以拖动
modal:true,
title:"",
close: function(event, ui) {
document.getElementById("dlgFrame").src="about:blank";
}
});
});
function openDialog(title,src,width,height,position){
myDialog.dialog('option','title',title);
document.getElementById("dlgFrame").src=src;
//if (!width) width=900;
//myDialog.dialog('option','width',width);
//if (!height) height=500;
//myDialog.dialog('option','height',height);
//if (!position) position="center";
//myDialog.dialog('option','position',"center");
myDialog.dialog({ position: ['center','middle'] });
myDialog.dialog('option','modal',true);
// alert(document.body.scrollHeight);
// document.body.scrollTop=250;
myDialog.dialog('open');
// alert(document.body.scrollHeight);
//document.body.scrollTop=250;
}
</script>
<script type="text/javascript">
function openPRO(pol_no,insu_seq,customerid){//add tanguang 20120905 costomerId
//document.getElementById("dlgFrame").src=
//openDialog('险种信息',"<%=ctxPath%>/servlet/com.cntaiping.egp.clerk.InsuredServlet?sAction=exportProDetail&pol_no="+pol_no+"&customerid="+customerid+"&insu_seq="+insu_seq);
document.getElementById("dlgFrame").src="<%=ctxPath%>/egp/cleck/file_upload.jsp";
myDialog.dialog('option','title','资质材料影像上载');
alert("scrollHeight"+document.body.scrollHeight);
myDialog.dialog('open');
//alert("scrollHeight"+document.body.scrollHeight);
document.body.scrollTo(document.body.scrollHeight);
///alert(document.body.scrollWidth );
}
</script>
<div class="right" style="width:765px;margin-top:-20px;" id="right">
<form action="<%=form.getActionURI()%>" method="post">
<input type='button' onclick='onclick="openPRO(1,2,3)">
<div class="hide" id="dialog" title="Dialog Title" >
<iframe
id="dlgFrame" name="dlgFrame" class="ui-layout-center" width="900px"
height="520" frameborder="0" scrolling="auto" style="margin-left:18px;"></iframe>
</div>
</form>
</div>
</div>
</div>
请问为什么每次点击完查询列表的数据后,弹出的iframe 框架自动把滚动条寄到最上面去了,求解
效果如图,就是纵向滚动条始终回到顶部了,导致弹出框不能在垂直的正中央,谢谢!