shows the popup
id | string|number | item id, for radio buttons you should specify [id,value] |
// initializes toolbar
var myToolbar = new dhtmlXToolbarObject({
parent: "parentId",
icon_path: "../common/imgs/",
items: [
{type: "button", id: "open", img: "open.gif"},
{type: "button", id: "close", img: "close.gif"}
]
});
// initializes popup
var myPop = new dhtmlXPopup({
toolbar: myToolbar,
id: ["open","close"]
});
// show popup near specified item
myPop.show("open");
// or
myPop.show("close");
A popup can be shown:
In the case of the stand-alone initialization:
params:
// initializes popup
var myPop = new dhtmlXPopup();
myPop.attachHTML("I'm a popup near the specified area");
// assuming that we have a div and we need to show a popup near it
var myArea = document.getElementById("myArea");
// collect coordinates and dimensions
var x = window.dhx.absLeft(myArea);
var y = window.dhx.absTop(myArea);
var width = myArea.offsetWidth;
var height = myArea.offsetHeight;
// show popup
myPop.show(x, y, width, height);
Back to top