Using jquery we can put an image having NO VALUE FOR ITS HEIGHT in the vertical middle of the window. Example:
Does anyone know if this is possible with css alone?<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
function vert_middle()
{
$('#funes').css('top', '50%');
$('#funes').css('margin-top', -$('#funes').height()/2+'px')
}
window.onload=vert_middle
window.onresize=vert_middle
</script>
</head>
<body>
<img id="funes" src="http://upload.wikimedia.org/wikipedia/commons/5/51/Louis_de_funes_1978_ws_1-zoom-frameless.jpg" style="position: absolute; left: 45%; width: 10% ">
</body>
Thanks.



Reply With Quote

Bookmarks