here is a quickly hacked, quite short and FF-tested version:
- <html>
-
<head>
-
<script type="text/javascript">
-
-
function maskItem(id) {
-
var node = document.getElementById(id);
-
var coords = getCoords(node);
-
-
var mask = document.createElement('div');
-
-
mask.style.backgroundColor = 'red';
-
mask.style.opacity = '0.5';
-
mask.style.position = 'fixed';
-
-
for (var i in coords) {
-
mask.style[i] = coords[i] + 'px';
-
}
-
-
node.parentNode.appendChild(mask);
-
}
-
-
function getCoords(node) {
-
var coords = {
-
top : node.offsetTop,
-
left : node.offsetLeft,
-
height: node.offsetHeight,
-
width : node.offsetWidth
-
};
-
-
return coords;
-
}
-
-
</script>
-
</head>
-
<body>
-
<input type="text" id="myInput" value="foo"/>
-
<input type="button" onclick="maskItem('myInput');" value="mask item"/>
-
</body>
-
</html>
-
the getCoords() method might need to be extended to retrieve the correct position and measures in IE, you might have a further look
here ... even the mask's css could be adapted with using a transparent image with a progress indicator or whatever ... :)
kind regards