myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <werner.p...@gmail.com>
Subject Re: OT: disable a page before showing a popup
Date Wed, 21 Mar 2007 23:12:04 GMT
Dave schrieb:
> How to disable a page (change color to light grey and the disabled page
> will not accept key/mouse events) before showing a popup? modelDialog
> has this feature. Can I use javascript to do the trick?  Thanks for ideas.
>  
You have to use javascript...
What dojo does is basically to push a div with a higer z-index over
the the page, thus layering something on top of it.

in pure html there is no way to do it,...

this is not a working code but you get the idea


<div id="layer" style="visibility: hidden; position: absolute;">
</div>


...

function layerDiv() {
	var layer = document.getElementById("layer");
	layer.style.width = window.innerWidth;
	layer.style.height = window.innerHeight;
	layer.left: 0px;
	layer.top: 0px;
	layer.style.zIndex = 98;

	layer.style.visibility = "visible";

}



probably not working but this is basically the idea behind this
layering, you push a div over the visible area, probably instead of the
window width and height you should use the width and height of the
document.body.

and for the greying you have to alter the colors and transparency settings.

the dialog then is pushed as another position absolute div on top of it.
Have in mind that both divs should be located outside of any form
otherwise the absolute positioning will fail on ie6 (welcome to dhtml
browser hell)

but why do you want to make it yourself, the modal dialog does exactly
what you want, and also makes a position fixed for you crossbrowserwise,
if needed?




Mime
View raw message