I'm running into a bug where my modal won't open in the center window. The code i'm currently using to measure the middle is the following:
var id = j('#share-modal');
// show modal, resize
j(id).css('top', j(window).height()/2-j(id).height()/2);
j(id).css('left', j(window).width()/2-j(id).width()/2);
j('#share-modal').fadeIn(500);
CSS
#share-modal {
display: none;
font-family: Arial, sans-serif;
width: 537px;
height: 510px;
position: absolute;
background: #FFF;
z-index: 100;
box-shadow: 3px 3px 3px #333;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
}
This is the only code I put that is supposed to be centering the code, but I can't tell if something else is interfering.
View my Javascript here: http://pastebin.com/wZeY5azT
You can view it here: www.paultibbs.com/varier
Scroll down and click on the "Share with friend" button.
If anyone can help me solve this bug, i'd be greatly appreciated!