PopUp Height based on mouse location
This is the code I'm currently working with:
-
function centerPopup(){
//request data for centering
var windowWidth = 650;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#popupContact").height();
var popupWidth = $("#popupContact").width();
//centering
$("#popupContact").css({
"position": "absolute",
"top": windowHeight/5-popupHeight,
"left": windowWidth/2-popupWidth/2
});
//only need force for IE6
$("#backgroundPopup").css({
"height": windowHeight
});
}
Instead of the pop-up appearing relative to the document height, I'd like it to appear relative to where the mouse has clicked. Any help would be GREATLY appreciated.