Work with Popup

Hiding/showing Popup

You can hide and show a popup using the hide() and show() methods. The show() method takes the following parameters:

This method should be called each time you need to render a popup on a page.

popup.show("popup_container");

This is how you can hide a popup:

popup.hide();

Related sample:  Popup. Show/Hide

Checking visibility of Popup

You can easily check whether a popup is visible with the help of the isVisible() method. It returns true, if a popup is visible.

popup.isVisible(); // -> true/false

Related sample:  Popup. Is Visible

Attaching content

You can easily attach some HTML content to a popup via the attachHTML() method. It takes as a parameter a string with HTML.

var popup = new dhx.Popup();
popup.attachHTML("<h1>Hello, I'm popup</h1>");
popup.show("popup");

Related sample:  Popup. Html Content

Attaching DHTMLX components

dhtmlxPopup allows attaching other components of the library using the attach() method. It takes two parameters:


popup.attach("Timepicker"); 
 
popup.show();

Related sample:  Popup. Attach Timepicker

Back to top