In this chapter you will know how:
To manage dhtmlxPopup visibility you have 3 methods:
Let's consider as an example of usage these methods - attaching dhtmlxPopup to a custom object when you need to manually regulate showing/hiding of the pop-up window:
<input type="text" onclick="showPopup(this);" onblur="hidePopup();" value="click"> <script> function showPopup(inp) { if (!myPop) { myPop = new dhtmlXPopup(); myPop.attachHTML("You can enter some text into here"); } if (myPop.isVisible()) { myPop.hide(); } else { var x = getAbsoluteLeft(inp); // inner dhtmlx method, return left position var y = getAbsoluteTop(inp); // inner dhtmlx method, return top position var w = inp.offsetWidth; var h = inp.offsetHeight; myPop.show(x,y,w,h); } } function hidePopup() { if (myPop) myPop.hide(); } </script>
The library provides 3 predefined skins:
'dhx_skyblue' | 'dhx_web' | 'dhx_terrace' |
---|---|---|
To set the skin for a dhtmlxPopup object you should use the setSkin method.
var myPop = new dhtmlXPopup( ... ); myPop.setSkin("dhx_web");
The following order is used to determine the skin on load:
For example, if you include on the page the only css file - “dhxpopup_dhx_terrace” - and instantiate dhtmlxPopup without specifying the skin parameter, then the “dhx_terrace” skin will be detected automatically.