Trigger onresize event for simplemodal / dynamic modal height
<p>Is there a way that I could trigger an onresize() event for my window in javascript/jQuery?</p>

<p>I tried:</p>

<pre><code>$(window).resize();
</code></pre>

<p>but that didn't seem to work exactly as expected. The simplemodal jQuery plugin gives you the option to <code>autoPosition</code> your modal window. Sometimes in IE, the modal shows up a little off center but as soon as I manually make a change to the window size it centers perfectly. So I want to just trigger the onresize event so this will automatically center with the <code>autoPosition</code> of simplemodal set to <code>true</code>.</p>

<p>Ok, I think part of my problem was that I was trying to make the height of the modal dynamic, if the content would change in the modal by showing or hiding elements, so would the size respectively.</p>

<p>Heres my modal call:</p>

<pre><code>$(selector).modal({
    //autoPosition: true,
    //autoResize: true,
    onShow: function(dlg) {
        $(dlg.container).css('height', 'auto') // dynamic height based on content
    },
    onOpen: function(dialog) {
        dialog.overlay.fadeIn('slow', function() {
            dialog.data.hide();
            dialog.container.fadeIn('slow', function() {
                dialog.data.slideDown('slow');
            });
        });
    },
    onClose: function(dialog) {
        dialog.data.fadeOut('slow', function() {
            dialog.container.hide('slow', function() {
                dialog.overlay.slideUp('slow', function() {
                    $.modal.close();
                });
            });
        });
    }
});
</code></pre>

<p>If I comment out the onShow attribute, things work again. So I guess maybe that was part of the issue. Is there a way to resize the modal dynamically based on a content, that won't creat this problem ?</p>

<p>Using <code>simplemodal-1.3.4</code></p>
