Let me explain a bit more, I am trying to have a large area (full screen) with a fixed size hole in it. The hole will follow the mouse around the screen. Think of having a
Conclusions:
You may want to use the canvas
tag, which can work on IE using excanvas, http://excanvas.sourceforge.net/, and you would then put the text inside the canvas tag. It can react to events as it is an html element, basically.
I would suggest a single div with which is partially opaque. Have it have transparent background, but black borders. As the mouse moves around, adjust the thickness of the borders. Because it's partially opaque (say 50%), the part covered by the borders will seem grayed out. Remember, borders can be as thick as you want - even hundreds of pixels. This way you don't need to use images, or modify the DOM at all - just change the style properties of the single div.
EDIT: Just noticed the requirement to let mouse events through. I believe the single div solution fails here. A four-div solution would need to be used. However, this can still be done by using black, semi-opaque divs (instead of background images). They can then be resized (via dynamically changing the style
object) rather than removed and recreated (not sure if this is what OP means by "re-painting").
Unfortunately, the DOM's design doesn't allow events to "pass through" a block to anything below it. This is why toolkits which allow drag 'n drop (mootools, jquery, etc...) are so complicated. They pre-calculate the location of all "droppable" elements and do mass comparison of coordinates of the dragged object v.s. the droppable objects, tied to the onmousemove events. That's one way around the limitation you could explore. Figure out what elements you want to react to your "window" and do the coordinate comparisons, etc...
I've seen partial solutions that involve offsetting the dragged element from the mouse pointer, so that the pointer's "clear" and can properly trigger events, but that would most likely ruin the window effect you're going for.
Most likey you're stuck dragging around those 4 divs. Do they have to have the background image? CSS opacity not a candidate?