.myclass {
position:fixed;
width:400px;
height:200px;
margin-left:-200px;
margin-top:-100px;
left:50%;
top:50%;
}
var widthDevice = $(window).width(),
heightDevice = $(window).height();
var widthMain = $('.myclass').width(),
heightMain = $('.myclass').height();
$('.myclass').css({
'left': widthDevice - (widthMain / 2)
//...
});