jquery has a very good UI plug-in, dialog plug-ins, his official website has various forms of demonstrations: http://jqueryui.com/demos/dialog/, may be used more or its default mode, the specific use of the judge on the Internet, Also have Chinese explanation address, I will not repeat, recently in the pop-up frames page, carefully look, and dialog plug-in modal form mode is very similar, demo demo effect: http://www.lovewebgames.com/addNews.aspx
Is such an effect, to login registration pop-up layer, as for why I do not directly with modal form to do it? Because I like it, you care about me. So I made a jquery. The following dialog plug-ins need to refer to the original dialog file. The specific code is as follows:
Copy Code code as follows:
(function ($) {
$.fn.openwidow = function (options) {
var divid = "Dialog" + Math.Round (math.random () * 100);
var settings = {
Id:divid,
WIDTH:300,
HEIGHT:200,
Modal:true,
Buttons: {
},
Show: "Explode",
Hide: "Highlight",
Title: "Hint",
URL: "/test.aspx",
Close:function () {
$ ("#" + this.id). Remove ();
Debugger
if (document.getElementById (this.id))
Document.body.removeChild (document.getElementById (this.id));
}
};
if (options) {
$.extend (settings, options);
}
$ ("Body"). Append (' <div id= "' + settings.id + '" title= "Dialog title" ><p class= "Loading" ></p></div > ');
Dialog
$ (' # ' + settings.id). Dialog ({
Autoopen:false,
Title:settings.title,
Width:settings.width,
Height:settings.height,
Modal:true,
Bgiframe:true,
Show:settings.show,
Hide:settings.hide,
Buttons:settings.buttons,
Close:settings.close,
Open:function () {
$ ("#" + settings.id). html (' <iframe src= ' + settings.url + ' "frameborder=" 0 "height=" 100% "width=" 100% "id=" Dialogfra Me "scrolling=" Auto "></iframe>");
},
Resizestop:function () {
$ ("#dialogFrame"). CSS ("width", parseint (This). CSS ("width")-5);
$ ("#dialogFrame"). CSS ("height"), parseint ($ (this). CSS ("height")-5);
}
});
$ (' # ' + settings.id). Dialog ("Open");
return this;
};
}) (JQuery);
I think we should all understand, there is nothing complicated, that is, repeat and repeat the work. Even a lot of parameters themselves are dialog, I just added a layer of skin. I believe this method is a lot of beginners want to use, after all, not everyone likes and skilled use of Ajax, so this time the use of IFrame is still very large.
And hope that interested friends to join my Q group: 70210212, 5678537, usually more than the communication, there are problems without a person to think.