How to create a Modality Mask in YUI2?

60 Views Asked by At

I want to know how a modality mask can be created in YUI2 without using a configuration attribute. While rendering a YUI Panel, the mask normally renders before the panel is displayed. I want to do this in order to resolve a cross browser compatibility issue.

Can anyone share a snippet for this?

1

There are 1 best solutions below

0
the-petrolhead On BEST ANSWER

Just figured out a way to do this.

YUI container.js has various functions to deal with masks.

buildMask()
sizeMask()
showMask()/hideMask()

The only difference is I need to call them manually like below -

var panel = new YAHOO.widget.Panel('nodeId', configs);
...
panel.buildMask();
panel.sizeMask();
panel.bringToTop();
panel.showMask();
...
panel.render();