<script type="text/javascript">
$(document).ready( function () {
$('#cell').css('height',$(window).height()+'px');
});
</script>
as you see I have this script that defind the #cell's height to be as the page's height.
but outside of this div i got another div that put it top=50% and margin-top=-218px to be in the middle of the screen.
because of that, the height of the height of the page is bigger then is should be.
I tried to do something like this but i cant find the right syntax-
<script type="text/javascript">
$(document).ready( function () {
var p = $("mainWrap");
var position = p.position();
heightPage = $(window).height()
heightTop = position.top;
heightFixed = heightPage - heightTop + "px";
$('#cell').css('height', heightFixed);
});
</script>
EDIT: i was able to do this like so
<script type="text/javascript">
$(document).ready( function () {
var s = document.getElementById('cell');
var fixedHeight = $(window).height() - s.offsetTop;
fixedHeight = fixedHeight + "px";
$('#cell').css('height',fixedHeight);
});
thanks for your comments.
for the guy that commented that ask for what i was trying to do: i centered my content by wrapping it with a DIV that pushing it to the middle by 'top:50%' and margin it back to the top so it will be in the middle by 'margin-top:208px' (its the height of the content). besides that, i got a footer that hides under the screen scrolled (no matter what is the resolution of the screen) and because of the centering thing, the footer was too much scrolled.. the top:50% pushed the footer deep down and i had to find a way to push it back up.. that is where the jquery part came in. i know there is a alot of ways to keep the footer down or under the screen but im working with a cms patform and there is alot of bugs and inherited css so it was too complicated.
anyhow everthing is ok now and its working, hope it will be usefull for someone someday.
thanks for the help.
(heightPage - heightTop) + "px";