1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
var protectDiv = new Element("div", {style: "display:none;position:absolute;background-color:#000;z-index:1000;"});
protectDiv.setOpacity(0.2);
$(document.body).insert(protectDiv);
function protectDiv(divToProtect) {
var dim = divToProtect.getDimensions();
var pos = divToProtect.cumulativeOffset();
protectDiv.setStyle({
width : dim.width + "px",
height : dim.height+"px",
top : pos.top + "px",
left : pos.left + "px"
});
protectDiv.show();
}
function hideProtectDiv(){
protectDiv.hide();
} |
Partager