像下面这样showModalDialog后为什么有滚动条,但去掉第一行就没有,除了去掉第一行该怎么改
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
function Test()
{
window.showModalDialog("test.html",window,"dialogWidth:"+window.screen.availWidth+"px;dialogHeight:"+window.screen.availHeight+"px;" );
}
</script>
</head>
<body style="border:solid 1px red;">
<input type="button" value="open" onclick="Test();">
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
function Test()
{
window.showModalDialog("test.html",window,"dialogWidth:"+window.screen.availWidth+"px;dialogHeight:"+window.screen.availHeight+"px;" );
}
</script>
</head>
<body style="border:solid 1px red;">
<input type="button" value="open" onclick="Test();">
</body>
</html>
test.html内容很多,当超过了dialogHeight,dialogWidth 范围时候就有滚动条了
不要滚动条可以 在test.html页里增加
<body scroll="no">
<body style="border:solid 1px red;" scroll="no">
设大点算了!
一、我body内容并不多你就看这个测试页面,就一个按钮,而且我body里面有个边框自己在浏览器里面看就知道并没有超出窗口
二、scrollbars是不能等于0,因为有可能内容会超出,不能把滚动条去掉只能说auto就是超出时才显示。
三、我说了除了去掉第一行该怎么改,别又说去掉第一行
四、上面有个人说试了,没有滚动条,我不知道是不是和浏览器有关我的是ie7
不要滚动条可以 在test.html页里增加
<body scroll="no" > overflow:hidden
那在ie7里面该怎么办
{
window.showModalDialog("test.html",window,"dialogWidth:"+window.screen.availWidth+"px;dialogHeight:"+window.screen.availHeight+"px;" );
}
</script>
弹出窗口的属性里定义属性 window.showModelDialog("url","name","参数:值;参数:值;……")
url:对话框窗口链接地址
name:对话框的名称,可以为空
scroll:是否有滚动条,0表示无,非0表示有
status:是否有状态栏,0表示无,非0表示有
help:是否有问号,0表示无,非0表示有
resizable:是否可以用鼠标拖动改变框提大小,0表示不可以,非0表示可以
dialogWidth:对话框宽度值
dialogHeight:对话框高度值
window.showModelessDialog("http://www.joekoe.net/,"dialogwin",
"scroll:0;status:0;help:1;resizable:1;dialogWidth:480px;
dialogHeight:320px")
iframe参数说明
marginwidth:网页中内容在表格右侧的预留宽度;例如:marginwidth="20",单位是pix,下同。
marginheight:网页中内容在表格顶部预留的高度;
hspace:网页右上角的的横坐标;
vspace:网页右上角的纵坐标;
frameborder:是否显示边缘;填"1"表示"是",填"0"表示"否"
scrolling:是否出现滚动条;填"1"表示"是",填"0"表示"否"
从来不用ie7...
注释:参数一:你要打开的窗体;参数二:打开窗体的名称;参数三:该窗体的属性:
例如:window.showModalDialog("baidu.html","百度首页","status=0;scroll=0;resizable=0");该语句将弹出一个百度窗体,窗体的名称为”百度首页“,窗体的属性为:无状态栏,无滚动条,窗体大小不可有用户去改动的窗体!此例中设计到了javaScript语言的代码!呵呵,自己看看吧!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >你换成这个标准 可以么
我的是这样的:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="text" name="txt1" />
<input type="text" name="txt2" />
<input type="text" name="txt3" />
</div>
</form> </body> </html>
把这个<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 去掉了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">替换成
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
这个也是正解
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
我是猎头公司的helen
现在有上海的。net开发的职位
4,5年的c#开发经验
英文可以沟通
项目很不错
难得的机会
有感兴趣的朋友联系我
msn:[email protected]
邮箱:[email protected]
不想把第一行去掉,showModalDialog要全屏可以改成其他方式但不能没有全屏,
弹出的窗口内容超出的时才出现滚动条,现在测试页面就一个按钮内容没有超出但仍然有滚动条
如果还回复说 scroll="no" 或因为我页面内容太多那就别回复为好
下面是测试页面test.html,弹出的页面也是这个页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
function Test()
{
window.showModalDialog("test.html",window,"dialogWidth:"+window.screen.availWidth+"px;dialogHeight:"+window.screen.availHeight+"px;" );
}
</script>
</head>
<body style="border:solid 1px red;">
<input type="button" value="open" onclick="Test();">
</body>
</html>