Menu
i need some help with this script.
for the id ‘section1’
i want to calculate the css margin-top property.
the margin-top equals the available screen height minus 920px.
hope someone can give a hint.
<script type=”text/javascript”>
$(window).load(function(){
$(window).resize(function(){
AvailHeight = window.screen.availHeight
var topmarge1 = AvailHeight – 920
$(‘#section1’).css(‘margin-top’, topmarge1+”px”); // <– set here
});
$(window).resize();
});
</script>