Javascript| pop-up Window | tips
One, in the following code, you just click to open a window, you can link to the Sadie Network. And when you want to close, just click to close the window you just opened.
The code is as follows:
<script language= "JavaScript" >
<! --
function Openclk () {
Another=open (' http://www.webjx.com ', ' newwindow ');
}
function Closeclk () {
Another.close ();
}
-->
</SCRIPT>
<FORM>
<input type= "button" name= "Open" value= "opening a Window" >
<BR>
<input type= "button" name= "Close" value= "closes this window" >
</FORM>
Second, the above code is too quiet, why not to a little dynamic? If you can give the page to a landing effect that how good ah!
The code is as follows:
<script>
function Drop (n) {
if (Self.moveby) {
Self.moveby (0,-900);
for (i = n; i > 0; i--) {
Self.moveby (0,3);
}
for (j = 8; j > 0; j--) {
Self.moveby (0,J);
Self.moveby (j,0);
Self.moveby (0,-J);
Self.moveby (-j,0);
}
}
}
</script>
<body >
Third, hate many websites always follow the default window to open, if you can control the open window as much as possible how good.
The code is as follows:
<script language= "JavaScript" >
<! --Begin
function Popuppage (L, T, W, h) {
var windowprops = "Location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes" +
", left=" + L + ", top=" + t + ", width=" + W + ", height=" + H;
var URL = "http://www.webjx.com";
Popup = window.open (URL, "Menupopup", windowprops);
}
End-->
</script>
<table>
<tr>
<td>
<form name=popupform>
<pre>
Open a page's parameters <br>
Distance from left: <input type=text name=left size=2 maxlength=4> pixels
Distance from the right: <input type=text name=top size=2 maxlength=4> pixels
Width of window: <input type=text name=width size=2 maxlength=4> pixels
Height of window: <input type=text name=height size=2 maxlength=4> pixels
</pre>
<center>
<input Type=button value= "Open this window!" ">
</center>
</form>
</td>
</tr>
</table> you just have to enter a number in the corresponding dialog box to control the window of the page you want to open very well.