Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div id="body">
    <div id="left_column">
    /* some content */
    </div>
    <div id="right_column">
      <div class="img"></div>
      <div class="img"></div>
      <div class="img"></div>
      <div class="img"></div>
      <div class="img"></div>
    </div>
  </div>
</body>
</html>
 
#left_column {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  border: 1px solid black;
}
#body {
  position: relative;
  padding-left: 200px;
  float: left;
  border: 1px solid black;
}
.img {
  /* pretend img */
  width: 98px;
  height: 75px;
  background-color: #fff;
  border: 1px solid black;
  float: left;
  margin: 0;
}
#right_column {
  border: 1px solid black;
  float: left;
}
 
$(document).ready( function() {
  var column_width = Math.floor(($("#body").innerWidth()-$("#left_column").width())/100)*100;
  $("#right_column").css("width", column_width);
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers