一个新的小功能,用户希望打开的页面可以全屏显示~唔~不是实现F11那种效果,只是填满任务栏上方的屏幕~
<script type="text/javascript">
function openwintask(url) {
if (url != null) {
try {
var feature = 'top=0, left=0,toolbar=no,menubar=yes, scrollbars=yes, resizable=yes,location=no,status=no,channelmode = yes';
var newwindows = window.open(url, "", feature);
newwindows.moveTo(0, 0); //将新页面打开位置定位在屏幕左上角
newwindows.resizeTo(screen.width, screen.height); //设置新页面的大小~实际上也可以在上面的属性中设置~不过~不能最大化~原因未知~坐等牛人解答~
if (newwindows != null) {
newwindow.focus();//新页面获得焦点
}
}
catch (e) {
}
}
}
</script>
————————————————————————————————————————————————————————————————————————————————————————
方法。。。。。
<script type="text/javascript">
if (!window.opener || window.opener!='login'&&window.name!='EIS')
{
window.opener = 'login';
var feature = 'FullScreen=yes,scrollbars=no,menubar=no,resizable=no,location=no,status=no,toolbar=no';
var win = window.open('index.aspx','EIS',feature);
win.resizeTo(screen.width,screen.height);
win.moveTo(0,0);
window.close();
}
</script>
win.resizeTo(screen.width,screen.height + 50);
win.moveTo(0,-50);
... ...
ps:
1、设置open()方法中的features参数,每个参数具体解释,请参考:http://www.w3school.com.cn/htmldom/met_win_open.asp
2、若是想实现窗口全屏(F11效果),只需在上述属性中加一条fullscreen = yes即可~
——————————————————————————————————————————————————————————————————————
如果不行试试批处理打开吧。。这样打开只能使用 ALT+F4关闭了。
批处理打开IE URL
start "" "%systemdrive%\program files\internet explorer\iexplore.exe" -k "www.baidu.com"
这样打开的是百度页面 只能用ALT F4关闭