JavaScript Homepage Pop-up Tips Gallery

Source: Internet
Author: User
Tags window
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.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.