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: 功能部分有关,任何人都可以帮助我吗?

4

3 回答 3

1

What is the problem? If you are using it on a ASP.NET site, make sure to use the appendTo: 'form' option.

于 2010-04-10T14:47:41.903 回答
0

这是我通过创建和 2 个对象 1 是 osx 而其他是 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 回答