我正打算在我的項目網站上使用jquery Simple模式登錄和註冊。我試圖擁有2個模態,如here所述。但我仍然無法使其工作。這裏是我的代碼
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部分有關,任何人都可以幫助我?
歡迎使用Stack Overflow並感謝您的回答!但是......請你澄清一下嗎?這是如何使你有多個模態對話框?而且,它與TO仍然相關嗎? – 2012-10-11 01:03:25