How to create new pop-up Ajax windows, the same as uCoz ones. Let's start with an example:
Its code
Code
<a href="javascript://" onclick="new _uWnd('myName','Window title',500,200,{autosize:1,maxh:300,minh:100},'Here goes window content');">Click me</a>
We need the following part which is the code of an Ajax window itself:
Code
new _uWnd('myName','Window title',500,200,{autosize:1,maxh:300,minh:100},''Here goes window content');
where: myName – is a unique name of a window. This text is displayed nowhere but is used to work with such windows;
Window title – is a title that is displayed at the top of an Ajax window;
500 – width;
200 – height;
Here goes window content - is content of a window. Here HTML codes can be used.
And now let's add more features to the window.
Code
<a href="javascript://" onclick="new _uWnd('myName','Window title',500,200,{min:1,shadow:1,header:1,max:1,resize:0},'Here goes window content');">Click me</a>
The base of the code is the same. We have added the following part:
Code
{min:1,shadow:1,header:1,max:1,resize:0}
where:
Number 0 stands for "No"
Number 1 stands for "Yes"
min – displaying of 'minimize' button (we have '1' which means that the button is displayed);
shadow – adds shadow to the window;
header – displaying of the header (where the buttons 'minimize', 'maximize', 'close' and window title are located);
max – displaying of 'maximize' button
resize – allows users to change window size (we gave '0' therefore the size can't be changed)
You can also add the following features:
modal[1/0] – a modal window. If this option is enabled all other space will be covered with a semitransparent layer.
nomove[1/0] – forbids to move a window.