jquery ui dialog jsp中不居中

gaoxiangyangwpy 2013-06-24 04:33:24


<%@ 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>测试</title>


<link rel="stylesheet" href="js/dialog/themes/base/jquery.ui.all.css">
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>


<script type="text/javascript" src="js/dialog/jquery.ui.core.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.widget.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.button.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.position.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.resizable.js"></script>
<script type="text/javascript" src="js/dialog/jquery.ui.dialog.js"></script>
<script>
$(function() {
$( "#dialog" ).dialog({
width:400,
height:300
});
});
</script>
</head>
<body>

<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

<div class="demo-description">
<p>The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.</p>
</div>
</body>
</html>

...全文
124 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
gr1532879 2013-06-25
  • 打赏
  • 举报
回复
之前给公司改组件遇到过类似问题,在chrome正常,ie在左上角,主要因为ie下面$(window).height()和width获取为0.但是改个头好像就好了,你试试 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 这个头有问题 你把头改成<!DOCTYPE html>试试
gaoxiangyangwpy 2013-06-24
  • 打赏
  • 举报
回复
官方的例子,抄到jsp中,在火狐下左右居中,上下不居中,在IE下左右上下都不居中,而且设置大小,在火狐下正常,在IE下不正常。。。求大神帮忙给看看

87,915

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧