window.open的参数说明+点击链接窗口的一种漂亮的打开方法。

王朝asp·作者佚名  2006-01-09
宽屏版  字体: |||超大  

<SCRIPT LANGUAGE="javascript">

<!--

window.open ('page.html', 'newwindow', '100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no')

//写成一行

-->

</SCRIPT>

<SCRIPT LANGUAGE="javascript"> js脚本开始;

window.open 弹出新窗口的命令;

'page.html' 弹出窗口的文件名;

'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;

100 窗口高度;

width=400 窗口宽度;

top=0 窗口距离屏幕上方的象素值;

left=0 窗口距离屏幕左侧的象素值;

toolbar=no 是否显示工具栏,yes为显示;

menubar,scrollbars 表示菜单栏和滚动栏。

resizable=no 是否允许改变窗口大小,yes为允许;

location=no 是否显示地址栏,yes为允许;

status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;

</SCRIPT> js脚本结束

------------------------------------------------------------

<script language=JavaScript>

<!-- Original: Martijn Sinnema (ycrxzyj@163.com) -->

<!-- Web Site: http://www.ycrx.com -->

<!-- Begin

function expandingWindow(website) {

var heightspeed = 2; // vertical scrolling speed (higher = slower)

var widthspeed = 7; // horizontal scrolling speed (higher = slower)

var leftdist = 0; // distance to left edge of window

var topdist = 0; // distance to top edge of window

var winwidth = window.screen.availWidth - leftdist;

var winheight = window.screen.availHeight - topdist;

var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes,status=yes");

for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {

sizer.resizeTo("1", sizeheight);

}

for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {

sizer.resizeTo(sizewidth, sizeheight);

}

sizer.location = website;

}

// End -->

</script>

<a href="javascript:;"onClick="expandingWindow('new_page_1a.htm')" target="_blank">点击</a>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有