Adjust demo

this demo page is for adjust plugin for adjust width and height

by sarfarazdesigner

HTML

<div class="header">
	This is header section
</div>

<div class="container">
	<div class="inner">
    	<div class="insider">
        	<div style="padding:10px;">
                <h1 class="h1">content come in this div</h1>
                
                <div class="clear parent">
                
                    <div class="leftSection">
                        <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
            
                            It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
                             
                            
                            Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure...

CSS

*{margin:0; padding:0}
body{background:white; overflow:hidden;}
.header{border-bottom: 1px solid #d8d8d8;background: #eca83d;height: 62px;}
.container{background:#F4F4F4;}

.container .inner{padding:25px; }

.insider{ background:#fff;}
.insider h1{height:40px; padding:10px; margin-bottom:10px; background:#d53a62; line-height:40px; color:#fff;}

.leftSection{overflow: auto; float:left; width:300px; margin-right:20px;}
.rightSection{float:left; background:#ddd;}

.rightSection h3{margin-bottom: 10px}
.rightSection .left{overflow: auto;}

.clear:before,.clear:after {
	display: table;
	line-height: 0; 
	content: "";
}
.clear:after {
	clear: both;
}

JavaScript

// JavaScript Document
//creating some universal variable
var _W, _H, _header, _lH, _lW, _lH1, _lH2, _lH3;

var defaults = { 
		headerClass: '',
		containerClass : '',
		Hlevel1:{space:0, divClass :'', prevDivClass : ''},
		Hlevel2:{space:0, divClass :'', prevDivClass : ''},
		Hlevel3:'',
		Wlevel1 : {space:0, divClass : '', prevDivClass : ''},
		Wlevel2 : {space:0, divClass : '', prevDivClass : ''}
		
	};

adjust = function(options) {

    var opts = $.extend(defaults, options);

	console.log(opts);
	
	function performAdjust(){
		_W = $(window).width(); //retrieve current window width
		_H = $(window).height(); //retrieve current window height
		_headH = $(opts.headerClass).outerHeight(true);//retrieve current header height
		
		
		// take left height after header height subtract to window height
		_lH = _H - _headH
		
		//make a variable for level one height
		_lH1 = _lH - (opts.Hlevel1.space + $(opts.Hlevel1.prevDivClass).outerHeight(true))
		
		//make a variable for level two height
		_lH2 = _lH1 - (opts.Hlevel2.space + $(opts.Hlevel2.prevDivClass).outerHeight(true));
		
		
		//applying height on main container
		$(opts.containerClass).css({height:_lH});
		
		//applying height on level 1 div
		$(opts.Hlevel1.divClass).css({height:_lH1 });
		
		//applying height on level 2 div
		$(opts.Hlevel2.divClass).css({height:_lH2 });
		
		
		//take left width after level one element
		_lW1 = _W - ($(opts.Wlevel1.prevDivClass).outerWidth(true)+ opts.Wlevel1.space);
		
		//take left width after level one element
		_lW2 = _lW1 - ($(opts.Wlevel2.prevDivClass).outerWidth(true)+ opts.Wlevel2.space);
		
		
		//applying Width on level 1 div
		$(opts.Wlevel1.divClass).css({width:_lW1 });
		
		//applying Width on level 2 div
		$(opts.Wlevel2.divClass).css({width:_lW2 });
		
		
	};
	
	$(function() {
		performAdjust();
	});
	$(window).resize(function() {
		performAdjust();
	});
};

$(document).ready(function (){	
	adjust({
		headerClass : '.header',
		containerClass...