Easy to create pop-up windows

Source: Internet
Author: User
Tags window dreamweaver
Pop-up window "How do I make pop-up windows?" "This is a question that Dreamweaver beginners often ask. Find a site to provide special effects, or down a special effects tool to paste the code can not get! It's not easy. In fact, the easiest way is to use our most commonly used Dreamweaver. A general pop-up window, a few simple locations can be completed. Don't believe it? Come and see! Just follow these steps and you can easily make pop-up windows.

1. First of all, from the menu bar window->behaviors (Window-> behavior) or directly press the shortcut key SHIFT+F3 pull up the behavior panel.

2. As shown, add the behavior by adding "+" in the upper-left corner of the behavior panel, and select the "Open Browser window (popup)" Behavior in the pop-up menu.

3. After you select the behavior, the Open Browser Window dialog box pops up, as shown in the figure. Just fill in the dialog box with the appropriate window information, press "OK" to complete the pop-up window customization. which

URL to display: For the address you want to display in a new window, you can enter the address directly, or you can press the "Browse" button to specify it.

"Window width" and "Window Height": The width and height of the new window, respectively, PX.

"Attributes": for the properties of the window.

"Navigation Toolbar", "Menu Bar", "Location Toolbar", "Scrollbars as Needed", "Status Bar", "Resize Handles"

Represents the toolbar, menu bar, positioning toolbar, scroll bar, and changing the size handle, respectively. Selecting the check mark before the corresponding position represents the corresponding attribute in the new window.

"Window name": The name of the target window. You can pick one up, or you can specify the name of a window within a frame group. When you make a pop-up window, the name can be a random one.

After completing the previous steps, the behavior panel will look like this, which means that the load page (onLoad) opens with a new browse window.

In fact, the process of adding behavior to the behavior panel is to Dreamweaver the process of generating JavaScript code. In the previous steps, the following code was generated. Comments in bold below, "<!-" and "-->" For that part of the code:

< HTML >

< head >

< title > Untitled Document </title >

< meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

< script language= "JavaScript" >


function Mm_openbrwindow (theurl,winname,features) {//v2.0

window.open (Theurl,winname,features);



</script ><!-Open the window based on the values passed over-->

< body bgcolor= "#FFFFFF" text= "#000000" >

<!-sets the value of each property of the pop-up window, passes the value to each corresponding parameter, and sets the firing event to onload-->

Pop-up window effect

</body >

You can understand the above code by calling the Mm_openbrwindow () method when the OnLoad event is fired (that is, when the image or end of the page is loaded), and the value

"' yourpage.htm ', ' winname ', ' Toolbar=yes,location=yes, Status=yes,menubar=yes,scrollbars=yes, Resizable=yes, width=300,height=200 ' "

(here is called the argument) to pass in the corresponding formal parameter-"theurl,winname,features", for window.open () to use. Note that all three parameters are enclosed in single quotes. In this code, the most critical sentence is:

"window.open (theurl,winname,features)"

It means to open the page on the theURL address in a window named Winname, according to features's characteristics.

After understanding the meaning of the code, we can know that the code can write directly: in < BODY > Join

A sentence. This type of writing is the same as Dreamweaver automatically generates code.

We already know the meaning of the three parameters in window.open ()-The first is the address of the page to be displayed, the second is the name of the target window, and the third is a description of the window's appearance characteristics. The first to second argument is not much, let's talk about the third argument. For the third argument, we can write this

"' Toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=300, height= 200,left=100, top=100 ' "

Here toolbar represents the toolbar, location represents the address bar, directories represents the navigation bar, status is the state bar, menubar is the menu bar, scrollbars is the scroll bar, resizable is the change size handle, and width, Height represents the width and height of the window, and left and top indicates where the window pops up.
toolbar, location, directories, status, menubar, scrollbars, resizable values can be set to Yes, no, 1, or 0,yes (1) to indicate that the new window has this attribute, no (0) or No. The width, height, left and top values should be filled in with the number of PX.

Do you understand what you've said so much? Is it easy to create pop-up windows by adding behavior to the Dreamweaver? Handwriting code is also not very difficult! As long as you practice, in a very short period of time, you will feel: the original pop-up window, is so simple!

Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.