• No categories
Aug
11
2011

Increase Decrease Web Page Size based on window size

Hello Everybody, Today i will show simple jquery code to adjust the contents div size according to window size.
Both right and left side bars will remain at their actual size but the width and height of contents will adjust
accordingly. Jquery Code for width handling is given below and you can download full demo by click on Download Demo-

<code>
$(document).ready(function(){
var leftBarWidth = $(‘#leftsidebar’).width();
var rightBarWidth = $(‘#rightsidebar’).width();
$(‘#contents’).width($(window).width()-(leftBarWidth+rightBarWidth));
$(window).resize(function() {

$(‘#contents’).width($(window).width()-(leftBarWidth+rightBarWidth));

});
});
</code>

About the Author:

Comments are closed.