YUI provides the "fixedcenter" property that allows you to center your dialog boxes at all times. that is if user scrolls down a long page, your modeless dialog is still centered and will scroll down along with the rrest of the page. For example the fixedcenter below positions the dialog box at the center of the screen.
YAHOO.mydialog.container.dialog1 = new YAHOO.widget.Dialog("divDisalog",
{
width : "256px",
fixedcenter : true,
constraintoviewport : false,
close :true,
x:180,
draggable: true,
underlay:"none"
} );
However in certain cases you may want to shift your dialog slightly off the center while still having it scroll down or be shifted off center at all times. To shift your dialog add a margin to the dialog boxes HTML style. for example to shift it to the left from the center you may use code such as this example that may be applied to your div tag. Below we get the benfits of centering but we have also shifted 128 pixels to the left:
id="divFlrsDisalog" style="margin-left:-128px;
Monday, January 7, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment