Automatically shut down the web page with Dreamweaver design
http://tech.tom.com
March 26, 2004 13:11
Source: CCID NET
When designing a page, a sub-window is often opened from a page for viewers. Typically, the content in this sub-window has been seen by the viewer. It is no longer necessary for the viewer, and they often have to turn off these small windows, causing many browser windows to open, consume a lot of resources. Therefore, we can design the sub-window into the form of automatically shut down after a period of time. In this example, two pages are made, as shown in Figure 1, index.html is a page displayed in the sub-window, and in the page named FirstPage.html, it is included in the sub-window to open INDEX.html links. When you click on the link, you will open Index.html in the sub-window. You can directly click the "Close" link to turn off the sub-window, or you can ignore it, after 15 seconds, the child window will automatically turn off.
Figure 1 The browser pop-up page is described below: 1. Generate an SMLPLE folder in the local site. 2. In the SMLPLE folder, generate a file called index.html and named firstpage.html. 3. Double-click Index.html to open the document, enter the design view window of the document. 4. Click Menu View / Head Content to display the header of the document. 5. Click the document head pane in the Design View window. Select Menu Insert / Invisible Tags / Script to open the INSET Script dialog. As shown in Figure 2, select the JavaScript option in the Language drop-down list box and enter "SETTIMEOUT" in the CocTento text box ("Self.close ()", 15000). Click the OK button to complete the script that automatically turn off the sub-window after inserting the document header after 15 seconds. In the code, 15000 represents 15,000 milliseconds, i.e., 15 seconds, or the number of time milliseconds you need according to needs.
Figure 2 Setting time 6. Enter "Off" in the Document window, enter "###" in the LINK text box on the property panel, set it to an empty link. 7. On the Quick Tag Editor on the left side of the status bar, click the tag button. Select the "Close" link, then press the Ctrl T key button to open the Quick Tag Editor and enter the editing tag mode of the Quick Tag Editor. Then enter "οnclick =" selfclose () "before"> "". As shown in Figure 3, the setting is complete, click the OK button to confirm the operation. Thus, after INDEX.html is opened as a sub-window, click the link to immediately close the sub-window.
Figure 3 8. Save the index.html file and exit the Dremweaver window of INDEX.html. 9. Now design the FristPage.html page. In the SMLPLE folder in the local site, double-click FRISTPAGE.HTML, open this document, and enter the design view window of the document. 10. In the document, enter "Click here to open the sub-window". Then enter "###" in the LINK text box on the properties panel, and set it to empty link. 11. You can open the INDEX.html window by setting the Open Browser WINDOW behavior for this link, but more convenient methods is to utilize the Quick Identoscope Editor. The method is to first place the insertion point into the link, then on the identification selector on the left end of the status bar, click the Identity button, select the entire link. Then press the Ctrl T key button to open the Quick Tag Editor and enter the editing identification mode of the Quick Tag Editor. In the "οnclick =" window.open ('index.html', null ',' width = 200px, height = 200px ') "" (shown in Figure 4). After setting, press the Enter key to confirm the operation. Figure 4 is set to open the link when you click on the link 12. The above operation completes the settings of this example. You can use File / Save to save your work with File / Save. Then press the F12 key to preview the page effect in the browser.