Friday, October 9, 2009

Make easily play a window

"How to make play window giving form? " , this is the question that Dreamweaver abecedarian asks via regular meeting. Look for a website that provides specially good effect, or it is Down tool of specially good effect is stickup code not have to! Not easy still. Actually lighter method is to use our most commonly used Dreamweaver. Play window giving form commonly, simple ground can be finished a few times bit. Do not believe? Will look! Want to be operated by the following paces only, you are made easily play a window effect.

1.Above all, from window of the Window- >Behaviors (in menu column - > behavior) or press face plate of behavior of v of shortcut key Shift+F3 directly.

2.If plan institute is shown, press top left corner of behavior face plate " + " date adds behavior, choose in playing the menu that go out " Open Browser Window (play a browser window) " behavior.



3.After choosing action, can shoot a dialog box of Open Browser Wi ndow, if plan institute is shown. Want to write corresponding window message in the dialog box only, by " affirmatory " hind can finish what give the window to playing is custom-built. Among them

"URL To Display " : Want to show the address of the webpage in new window for you, you can input an address directly, also can press " Browse " pushbutton is appointed.

"Window Width " with " Window Height " : What be new window respectively is wide and tall, the unit is Px.

"Attributes " : For the character of the window.

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

Represent column of tool column, menu column, fixed position tool, scroll respectively and change size handle. Choose on before corresponding position to ticking off, corresponding character is had in representing new window.

"Window Name " : For the name of target window. Can remove casually, also can designate the name of window of some of frame inter block. In make when playing a window, it is OK that the name removes casually.



Finished above after a few paces, behavior face plate will become below this appearance, express to be record in a page (OnLoad) while, open a new window that browse.

 

Actually, the process of behavior is added in behavior face plate, it is the course that Dreamweaver builds Javascript code. In a few paces above, generated following code. Show with thick substance below, show with thick substance below,, <! , " and "- - > " the is this part code annotate between:

<Html >

<Head >

<Title > does not have caption documentation</ 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 according to passing the cost that come over- - >

</ Head >

<Body Bgcolor="#FFFFFF" Text="#000000" OnLoad="MM_openBrWindow('yourpage.htm' , 'winname' , 'toolba r=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width=300, height=200') ">

<! , the value of each property that the setting flips a window, pass the cost each corresponding form ginseng, install arouse incident to be OnLoad- - >

Play a window effect

</ Body >

</ Html >

You can understand the code above so: When OnLoad incident is aroused (load when image or page end namely when) , call MM_openBrWindow() method, will be worth

"'yourpage.htm' , 'winname' , 'toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width=300, height=200' "

(Solid ginseng is called here) the form that passes into correspondence is joined -- " TheURL, winName, features " , use for Window.open() . Attention, 3 parameter should rise with only quote draw together. In these code, one the most crucial is:

"Window.open(theURL , winName, features) "

In the window that its means is WinName in the name, the character of the regulation that presses Features opens the page on TheURL address.

After the meaning that understood code, we can know such writing code is OK and direct: In<Join inside Body >

OnLoad="window.open('yourpage.htm' , 'winname' , 'toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width=300, height=200') "

. This kind writes law and Dreamweaver to generate the effect as good as of code automatically.

The meaning that we had known 3 parameter inside Window.open() -- the first address that wants indication page for place, the 2nd is the name of target window, the 3rd is the description of the exterior character of the window. The first, 2 parameter were not told more, we tell the 3rd parameter. To the 3rd parameter, such we are OK writing

"'toolbar=no, locat ion=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=300, height=200, left=100, top=100' "

Here Toolbar represents tool hurdle, location represents address hurdle, directories represents navigation, status is condition column, menubar is menu column, scrollbars is scroll, resizable is change size handle, and what Width, Height represents the window respectively is wide and tall, left, Top states the window plays the seat that give.
Toolbar, location, directories, status, menubar, scrollbars, the value of Resizable can be set for Yes, No, 1 or 0, yes(1) states new window has this character, no(0) is denied. And the value of Width, Height, Left, Top should be filled with the number, the unit is Px.

Told so much, did you understand? Behavior is added in Dreamweaver, make is playing a window very simple? Handwritten code also is not very difficult! Want you to be carried out slightly again only, inside very short time, you c an feel: Do so play a window, it is so simple!

No comments:

Post a Comment