Created
April 28, 2013 04:50
-
-
Save QETHAN/5475930 to your computer and use it in GitHub Desktop.
黑色半透明遮罩 SeaJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 黑色半透明遮罩层 | |
*/ | |
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