1

こんにちは、

プロジェクト サイトでのログインと登録に jquery Simple モーダルを使用する予定です。ここで述べたように、2つのモーダルを用意しようとしました。しかし、私はまだそれを機能させることができません。ここに私のコードがあります

jQuery(function ($) {
var OSX = {
    container: null,
    init: function () {
        $("a.osx").click(function (e) {
            e.preventDefault(); 

            $(this.id + "_osx-modal-content").modal({
                overlayId: this.id+'_osx-overlay',
                containerId: this.id+'_osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });
        });
    },
    open: function (d) {
        var self = this;
        self.container = d.container[0];
        d.overlay.fadeIn('slow', function () {
            $("#osx-modal-content", self.container).show();
            var title = $("#osx-modal-title", self.container);
            title.show();
            d.container.slideDown('slow', function () {
                setTimeout(function () {
                    var h = $("#osx-modal-data", self.container).height()
                        + title.height()
                        + 20; // padding
                    d.container.animate(
                        {height: h}, 
                        200,
                        function () {
                            $("div.close", self.container).show();
                            $("#osx-modal-data", self.container).show();
                        }
                    );
                }, 300);
            });
        })
    },
    close: function (d) {
        var self = this; // this = SimpleModal object
        d.container.animate(
            {top:"-" + (d.container.height() + 20)},
            500,
            function () {
                self.close(); // or $.modal.close();
            }
        );
    }
};

OSX.init();

open: function 部分と関係があると思いますが、誰でも私を助けることができますか?

4

3 に答える 3

1

何が問題ですか?ASP.NET サイトで使用している場合は、必ず appendTo: 'form' オプションを使用してください。

于 2010-04-10T14:47:41.903 に答える
0

これが私が作成することによってモーダルウィンドウに出す解決策です.2つのオブジェクト1はosxで、もう1つはrosxです!!!!

さらに支援が必要な場合は、@ miliwebdeveloper27@gmail.comにメールしてください:)いつでも喜んでお手伝いします...

jQuery(function ($) {
var OSX = {
    container: null,
    init: function () {
        $("input.osx, a.osx").click(function (e) {
            e.preventDefault(); 

            $("#osx-modal-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });             
        });
            $("input.rosx, a.rosx").click(function (e) {
            e.preventDefault(); 

            $("#osx-modal2-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });

        });
    },
    open: function (d) {
        var self = this;
        self.container = d.container[0];
        d.overlay.fadeIn('slow', function () {
            $("#osx-modal-content", self.container).show();
            $("#osx-modal2-content", self.container).show();
            var title = $("#osx-modal-title", self.container);
            title.show();
            d.container.slideDown('slow', function () {
                setTimeout(function () {
                    var h = $("#osx-modal-data", self.container).height()
                        + title.height()
                        + 20; // padding
                    d.container.animate(
                        {height: h}, 
                        200,
                        function () {
                            $("div.close", self.container).show();
                            $("#osx-modal-data", self.container).show();
                        }
                    );
                }, 300);
            });
        })
    },
    close: function (d) {
        var self = this; // this = SimpleModal object
        d.container.animate(
            {top:"-" + (d.container.height() + 20)},
            500,
            function () {
                self.close(); // or $.modal.close();
            }
        );
    }
};
OSX.init();
});
于 2011-11-09T06:31:40.777 に答える
0

複製

osx.js に -> osx2.js

そして名前を変更

input.osx2、a.osx -> input.osx2、a.osx2 osx-modal-content -> osx-modal-content2 osx-modal-data -> osx-modal-data2

もう少し単純化すると思いますか?

于 2012-07-27T08:37:36.970 に答える