Benjamin Sterling wrote:
>
> But I have another question, how do I set it so that the dialog box is 
> centered horizontally and vertically.  Is this something that I should 
> create a separate function for?  If so, what would point would you 
> recommend executing it?
I prefer to define the positioning of the dialog with pure CSS. The 
demonstrations @ http://dev.iceburg.net/jquery/jqModal/ all rely on this 
method. If you click the CSS tabs, it will expose the CSS I'm using to 
position that particular examples window/dialog/notice. NOTE; that the 
styling I'm using is not BULLETPROOF - there may be cross platform 
inconsistencies & better ways to go about it.

By default the dialog will be wrapped in a div of class "jqmWrap". This 
should define the posistion of the window; e.g.

<style type="text/css">

.jqmWrap { /* posistions & contains the modal window */
    position: fixed;
    top: 17%;
    width: 100%;
}

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWrap {
     position: absolute;
     top: expression((document.documentElement.scrollTop || 
document.body.scrollTop) + Math.round(17 * 
(document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 
'px');
}

</style>

Will center the dialog in the browser's viewport and FIX position it @ 
17% from the top.

If you know the height of the dialog, you can exactly center it in the 
window using the dead center (or similar technique); 
http://www.wpdfd.com/editorial/thebox/deadcentre4.html

~ Brice








_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to