Hey everyone, I could really use some help. I'm struggling to find the right formula to center this modal (http://www.queness.com/post/77/simple-jquery-modal-window-tutorial) on my browser, which has a size of 1263X582. I've been trying to use the following formula in jQuery:
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
So essentially, I would do 1263/2 - 395/2 for the top and 582/2 - 223/2 for the left, which would give me TOP:179.5 LEFT:434. However, when I inspect the element on the site to check if I'm correct, I get a different answer. I just want to confirm if my calculations are correct, or if there's a better way to solve this.
Thank you!