Skip to content

Instantly share code, notes, and snippets.

@QETHAN
Created April 28, 2013 04:50
Show Gist options
  • Save QETHAN/5475930 to your computer and use it in GitHub Desktop.
Save QETHAN/5475930 to your computer and use it in GitHub Desktop.
黑色半透明遮罩 SeaJS
/**
* 黑色半透明遮罩层
*/
define(function(require, exports, module) {
var elementCreate = require("./elementCreate");
var overlay = (function() {
var element = elementCreate.create("div", {
styles: {
display: "none",
width: "100%",
backgroundColor: "#000",
opacity: 0.35,
position: "absolute",
zIndex: 1,
left: 0,
top: 0,
bottom: 0
}
});
document.body.appendChild(element);
return {
display: false,
show: function() {
element.style.display = "block";
this.display = true;
return this;
},
hide: function() {
element.style.display = "none";
this.display = false;
return this;
}
};
})();
exports.overlay = overlay;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment