The following small make up will bring you a jquery custom plug-in-window implementation [Sample Code ]. I think this is quite good. I will share it with you now and give you a reference to this example to achieve the pop-up effect:
1. jquery. show. js
/** Implementation function: Click to display p * version number at the mouse position: 1.0 */(function ($) {$. fn. showDIV = function (options) {var defaults = {}; var options = $. extend (defaults, options); var showp = $ (this); var close, title, content; close = $ ("
"); title=$(" "); content=$(" "); showp.html(""); showp.append(close); showp.append(title); showp.append(content); close.html("X"); title.html(options.title); content.html(options.content); showp.css("display","block"); showp.css("position","absolute"); showp.css("left",($(window).width()-options.width)/2+"px"); showp.css("top",($(window).height()-options.height)/2+"px"); showp.css("width",options.width); showp.css("height",options.height); close.bind("click",function(){ showp.css("display","none"); }); }; })(jQuery);
22.16jquery.showp.css
body p { font-size:12px; text-align:center; } #container { background-color:#CCC; border:1px solid #000; width:1024px; height:600px; } #showp { background-color:#FF0; width:100px; height:100px; display:none; z-index:99; } .title { padding:10px; background:#F39; font-weight:bold; text-align:center; color:#FFF; } .close { margin:5px; position:absolute; right:0px; top::0px; padding:5px; color:#000; background:#FFF; } .close:hover { cursor:pointer; background:#CCC; } .content { text-align:left; padding:10px; }
3366demo.html