JS window.showModalDialog window.showModelessDialog 都可以showModelessDialog Method Internet Development Index --------------------------------------------------------------------------------Creates a modeless dialog box that displays the specified HTML document.SyntaxvReturnValue = window.showModelessDialog(sURL [, vArguments] [, sFeatures]) ParameterssURL Required. String that specifies the URL of the document to load and display. vArguments Optional. Variant that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from the dialogArguments property of the window object. sFeatures Optional. Variant of type String that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values: dialogHeight:sHeight Sets the height of the dialog window (see Res for default unit of measure). dialogLeft:sXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop. dialogTop:sYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop. dialogWidth:sWidth Sets the width of the dialog window (see Res for default unit of measure). center:{ yes | no | 1 | 0 | on | off } Specifies whether to center the dialog window within the desktop. The default is yes. dialogHide:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default is no. edge:{ sunken | raised } Specifies the edge style of the dialog window. The default is raised. help:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the context-sensitive Help icon. The default is yes. resizable:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window has fixed dimensions. The default is no. scroll:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays scrollbars. The default is yes. status:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays a status bar. The default is yes for untrusted dialog windows and no for trusted dialog windows. unadorned:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default is no. Return ValueVariant that returns a reference to the new window object. Use this reference to script properties and methods on the new window.
window.showModalDialog
window.showModelessDialog
都可以showModelessDialog Method Internet Development Index --------------------------------------------------------------------------------Creates a modeless dialog box that displays the specified HTML document.SyntaxvReturnValue = window.showModelessDialog(sURL [, vArguments] [, sFeatures])
ParameterssURL Required. String that specifies the URL of the document to load and display.
vArguments Optional. Variant that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from the dialogArguments property of the window object.
sFeatures Optional. Variant of type String that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values: dialogHeight:sHeight Sets the height of the dialog window (see Res for default unit of measure).
dialogLeft:sXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop.
dialogTop:sYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogWidth:sWidth Sets the width of the dialog window (see Res for default unit of measure).
center:{ yes | no | 1 | 0 | on | off } Specifies whether to center the dialog window within the desktop. The default is yes.
dialogHide:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default is no.
edge:{ sunken | raised } Specifies the edge style of the dialog window. The default is raised.
help:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the context-sensitive Help icon. The default is yes.
resizable:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window has fixed dimensions. The default is no.
scroll:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays scrollbars. The default is yes.
status:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays a status bar. The default is yes for untrusted dialog windows and no for trusted dialog windows.
unadorned:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default is no.
Return ValueVariant that returns a reference to the new window object. Use this reference to script properties and methods on the new window.
没有做过
<html>
<head>
<title>测试</title>
<script language="javascript">
var scrollFunc=function(e){
e=e || window.event;
if(e.wheelDelta && event.ctrlKey){//IE/Opera/Chrome
event.returnValue=false;
}else if(e.detail){//Firefox
event.returnValue=false;
}
}
/*注册事件*/
if(document.addEventListener){
document.addEventListener('DOMMouseScroll',scrollFunc,false);
}//W3C
window.onmousewheel=document.onmousewheel=scrollFunc;//IE/Opera/Chrome/Safari
</script>
</head><body style="font-size:30px;">
<br>SCRIPT脚本控制页面不随ctrl+鼠标滚轮而缩放。<br>
<br>CSS可以控制页面文字大小不随浏览器设置而改变。
</body>
</html>
var scrollFunc=function(e){
e=e || window.event;
if(e.wheelDelta && event.ctrlKey){//IE/Opera/Chrome
event.returnValue=false;
}else if(e.detail){//Firefox
event.returnValue=false;
}
}
/*注册事件*/
if(document.addEventListener){
document.addEventListener('DOMMouseScroll',scrollFunc,false);
}//W3C
window.onmousewheel=document.onmousewheel=scrollFunc;//IE/Opera/Chrome/Safari
</script>
及chrome中的缩放功能,这些都是浏览器的工具栏中的一部分功能,是无法被屏蔽的。
"('Que_Result_online.aspx?=full&t_id=" & testid & "','test_online'," & _
"'fullscreen=3,titlebar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes," & _
"resizable=yes,edge:Raised,left=0,top=0,width=400,height=300,false');</script>")
这样就可以了
现在在做撤销操作,也就是常用的ctrl+z。IE文字框自带的根本不好用,大家都知道。
为了实现这个功能,需要记录下当前的输入游标的位置点,撤销操作时便于恢复定位。
IE下寻找文字框里的游标位置点很麻烦,虽然有简单的办法可以找到,但如果超过100行的程序,恐怕按一个字母就得等四五秒才能算出来(还有个办法也简单,获取截至当前点的文字内容,然后算行数,col数,但这个办法在有滚动条的情况下,会让滚动条乱跳,因此放弃)。目前虽然已经大幅优化,160行的程序耗费的时间都在0.2秒左右。但担心上千行的代码就得等两三秒了。
因此想用计算当前游标的像素点高度/line-height简单获取行数,但问题来了,如果使用者进行过缩放,则此方法无效,行高不固定了。而在原始缩放状态下,就是固定的。所以请问下专业的theforever,有没有办法处理好这个问题呢?
担心你喷我不专业,搞无用的东西。所以我再说点背景,我在为公司开发web版简易开发软件(集成数据表定义,页面开发,js和sp编写,报表设计。全部web化,全部我一个人搞定。当然产生的数据有其它小组负责。目前已进入实际应用阶段),由于公司是多点的,而且可能邀请学生或者外包开发,在这种情况下,开放数据库显然不符合公司保密原则。
估计又有人想问,文字框怎么变色,自己思考吧。就我而言,开始使用了div contentEditable,但发现div的编辑非常不稳定,还是不如textarea,所以又转回textarea了。
感谢GOD!!让我没认识你~!
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />