Александр222,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
img{
position: absolute;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
jQuery.fn.fullCenter = function () {
var hWindow = $(window).height()+ 16;
var wWindow = $(window).width() + 16;
this.each(function (indx, element) {
var el = $(element);
var h = el.outerHeight(true);
var w = el.outerWidth(true);
var l = Math.min(hWindow, wWindow);
if (hWindow * (h / w) > wWindow * (w / h)) el.css({
height: hWindow,
marginLeft: (wWindow - w * (hWindow / h)) / 2
});
else el.css({
width: wWindow,
marginTop: (hWindow - h * (wWindow / w)) / 2
})
});
return this
};
$(window).load(function () {
$("img").fullCenter()
});
</script>
</head>
<body>
<img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt="">
<img src="http://tovar2.ru/userfile/%F0%EE%FF%EB.jpg" alt="">
<img src="http://img-fotki.yandex.ru/get/11/oleg-ivanov1966.20/0_2fa57_e915327f_XL" alt="">
</body>
</html>