Pre-defined HTML code: Not all code is generated and removed via JS.
Pre-defined CSS
/* Basic pop-up layer style */.my-popup-overlay {width:100%; Height:auto; /* Width height is defined by JavaScript */Position:absolute; top:0; left:0; z-index:1000; Background-color: #000; opacity:0.2; *filter:alpha (opacity=20);}. my-popup{position:fixed; top:200px; left:50%; /* Margin-left:; Defined by JS */_position:absolute; _top:expression (eval (document.documentElement.scrollTop + 200)); padding:10px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; Background:gray; z-index:1001;}. my-popup-close{Position:absolute; top:10px; right:10px; font-size:16px; width:20px; height:20px; Text-align:center; line-height:20px; Background: #0aa; Color: #f00; Cursor:pointer;}. my-popup-close:hover{Text-decoration:none; Color: #fff; Font-weight:bold;}. my-popup-content{background-color: #fff;} /* pop-up Layer style custom section */.popup-title{padding:25px 0 10px; font-size:14px;Text-align:center;}. popup-inner{width:300px; padding:20px;}
Plug-in code and application examples
(function ($) {/* * jquery Simple Popup * Body content passed in as parameter */var popup = function (HTML) {//html popup body A pop-up layer with a matte var $overlay = $ ("<div class= ' My-popup-overlay ' ></div>"),//define borders and Close buttons only, the rest defined in Parameters $popup = $ ("<div class= ' My-popup ' >" + "<a class= ' My-popup-close ' >x< ;/a> "+" <div class= ' my-popup-content ' > "+ (HTML? HTML:" ") + "</div>" + "</div>"); return {show:function () {//$overlay and $popup append to Body $ ("body"). App End ($overlay). Append ($popup); var = this; $overlay. css ({width: $ (window). Width (), Height: $ (document). Height () }); $popup. css ({"Margin-left":-($popup. Width ()/2) + "px" }); $ (". My-popup-close"). On ("click", Function () {that.hide (); }); }, Hide:function () {///remove this mask and pop-up layer $overlay. Remove (); $popup. Remove (); } }; }; application example var pup1html = '