I have designed one window in jsp in which there is a search button. when user clicks \"search\" button, the new window appears. But at this time i want my parent window to
The way I present modal windows is I create a DIV that covers the entire document, with a high Z-index, and then I prevent propagation of click events. In jQuery, I'd do it like this:
// When popup window is open:
var $cover = $('<div>');
$cover.css({
height: $(document).height(),
width: $(document).width(),
margin: 0,
padding: 0,
background: 'black',
opacity: 0.5
});
$cover.click(function(e) {
e.stopPropagation();
return false;
});
$cover.appendTo(document);
EDIT: Here's something I did quick-and-dirty using pure JS. I'm sure it can be improved for better cross-browser support.
http://jsfiddle.net/wVNbx/1/
You can use Greybox . Please visit the link : http://orangoo.com/labs/GreyBox/
Hope this will suffice your requirement.
function openSearchPopUp() {
popupWindow= window.open(url,'window','width=800,
height=600,location=yes,
menubar=yes,scrollbars=yes,
resizable=yes');
popupWindow.focus();
document.onmousedown = focusPopup;
document.onkeyup = focusPopup;
document.onmousemove = focusPopup;
}
function focusPopup() {
if(popupWindow && !popupWindow.closed) { popupWindow.focus(); }
}