0

私はこのスレッドの同じ問題を抱えています: SimpleModal jQueryプラグインについての質問-最初のオープン後に再中心化することは可能ですか?

可能な解決策を試しましたが、成功しませんでした。私のページにはスクロールバーがあり、モーダルを開いた後、divのサイズを変更するアクションがあります。ただし、div がウィンドウの表示領域を超えると、超えたコンテンツは非表示になります。ページをスクロールすると、モーダルは同じ位置に留まります!

IE8ではなく、IE6でうまく機能します。

4

2 に答える 2

0

ダイアログが大きくなりすぎないように、max-height と max-widthを設定することをお勧めします。次に、この div のスタイリングにoverflow:scrollが含まれていることを確認する必要がある場合があります。

于 2010-06-30T16:20:04.463 に答える
0

考えられる解決策の例:

$('#modalContent').modal({
    onShow: function (dialog) {
        var sm = this;

        // bind click event to get ajax content
        $('.link', dialog.container[0]).click(function (e) {
            e.preventDefault();

            $.ajax({
                ..., // your settings here
                success: function (data) {
                    dialog.data.html(data); // put the data in the modal
                    dialog.container.css({height:'auto', width:'auto'}); // reset the dimensions
                    sm.setContainerDimensions(); // resize and center modal

                    // if you want to focus on the content:
                    sm.focus();

                    // if you want to rebind the events
                    sm.unbindEvents();
                    sm.bindEvents();
                }
            });
        });
    }
});

私は、SimpleModal にサイズ変更関数を配置することを検討します。これにより、これらの手順のほとんどが処理されます。それまでは、これでうまくいくはずです。

-エリック

于 2010-06-30T18:45:16.170 に答える