2015-10-15 32 views
0

enter image description here超鏈接通向肖像格式化窗口利用的具體尺寸

在該頁面具有肖像格式打開了的尺寸400×350(像素)。我不知道如果我需要使用JavaScript或CSS來實現這一點,但是這是我的嘗試:從「index.html的」鏈接到新的頁面,「form.html」

鏈接:

<a style="text-decoration:none" href="form.html">Request 
Information</a> 

HTML的 「form.html」:

<html> 
<head> 
<title>Sean's Hardware Store</title> 
<script src="form.js"></script> 
</head> 
<body leftmargin=0 rightmargin=0> 
<br> 
<table width=100% border=0 cellpadding=0 cellspacing=0> 
<tr> 
<td width=95% align=right bgcolor=#ffffff> 
<img src="logo.jpg"><br> 
<font face=arial></font> </td> 
<td bgcolor=#ffffff>&nbsp;</td> 
</tr> 
</table> 
<br><br> 
<center> 
<table width=85%> 
<tr> 
<td valign=top> 
<form method=post action=""> 
    Name:<br> 
<input name="textname" size=35><br><br> 
E-mail:<br> 
<input name="textname" size=35> 
<br><br> 
<input type=submit name="button1" value="Submit"> 
</form> 
</td> 
</tr> 
</center> 
</body> 
</html> 

的Javascript:

window.onload=function() { 
    document.getElementById("window").onchange=function() { 
    window.open("","newWin","width=400,height=350"); 
    setTimeout(function() { 
    document.forms[0].submit(); 
    },100);// allow IE to get over the shock of opening a window 
    } 
} 

而且,可以索引和形式鏈接到同一Ĵ avascript文件?現在我有兩個單獨的js文件,因爲我不希望它們互相干擾(索引也有一些js)。謝謝。

回答

0

您可以直接從您的HTML是這樣做的:

<a href="form.html" onclick="window.open(this.href,'targetWindow', 
'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, 
resizable=yes,width=400, height=350'); 
return false;">Request Information</a>