I'm using the following code to create a modal (this is coffeescript)
contents = $('#modalContainer').load(link)
$.modal( contents,
onShow: (dlg) ->
$(dlg.container).css('height','auto')
)
and the modal starts off in the lower right quadrant of the browser window. Moving or resizing the browser window centers it as expected.
Running it without the onShow
callback to specify the height has the same effect.
Anyone have a simple solution to this?
Basic Javascript pitfall--the modal was drawing and positioning before the data had loaded. The fix is to specify the modal loading as a callback:
contents = $('#modalContainer').load(link, () ->
$.modal( contents,
onShow: (dlg) ->
$(dlg.container).css('height','auto')
)
)