Special effects window example
Understand the definition of the window attribute, let's take a few special applications, it is still a bitology.
Control pop-up window via function call
As the pop-up window defined by "Sample Code 2", the window will not pop up without calling the popupWindow method, let's take a few common call methods:
Automatically pop up the window when the page is loaded
>Automatically pop up the window when the page is closed
>>Trigger the pop-up window via a link or button
>>>>>>>>
Pop-up window timing close
Add the following small code in the pop-up window, the pop-up window will automatically turn off after 20 seconds. (This code is to be added to the pop-up window, not the home page)
Function closeit ()
{
Settimeout ("Self.close ()", 10000) // milliseconds
}
Script>
Add this code into the
tag, then modify the tag asAdd a shutdown button for the pop-up window
Add the following code in the pop-up window, a button will be added on the page, click this button, the pop-up window will automatically turn off without any tips.