Self-initiating popup window

by alano

JavaScript

$(document).ready(function () {
    var DIVSTYLE = "display:none; position:absolute; height:60%; width:60%; top:20%; left:20%; border-style: ridge; z-index:+1;";
    var $popup = $("<div>", { style: DIVSTYLE }).append($("<button>", { text: "Close" })).appendTo("body");
    $popup.on("click", "button", function(e) { $(e.delegateTarget).fadeOut("slow"); }).fadeIn("slow");
});