Using JQUERY for the background page layout control DIV to achieve left and right

  • 2020-03-30 01:15:04
  • OfStack

Background management are part of a website is to maintain a fixed position, editable partly changes over the browser, so sometimes use frame framework to implement this kind of form, pure div side rather than using the frame of the author to carry on the layout, what need to do, want to accomplish this way around here are control div type, fixed on the left, the right of changes over the browser JQUERY implementation code.
 
<script type="text/javascript"> 
//Adjust the size of the left and right layouts according to the browser size
$(window).ready(function(){ 
var wheight=$(window).height(); 
var wwidth=$(window).width(); 
$(".div_admin_left").css("height",(wheight-40)); 
$(".div_admin_right").css("height",(wheight-40)); 
$(".div_admin_right").css("width",(wwidth-285)+'px'); 
}); 
$(window).resize(function(){ 
var wheight=$(window).height(); 
var wwidth=$(window).width(); 
$(".div_admin_left").css("height",(wheight-40)); 
$(".div_admin_right").css("height",(wheight-40)); 
$(".div_admin_right").css("width",(wwidth-285)+'px'); 
}); 
</script> 

Here, the author fixed the left side, the right side with the browser changes and changes, but also with the browser is bigger and bigger, shrink also corresponding to proportional shrinking code, just for reference.

Related articles: