Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  
  .l_left{
width:58%;
float:left;
}
    .l_left img{
    width:100%;
    height:100%;
    display:block;
    }
    
    .l_left .next_prev{
    position:absolute;
    height:100%;
    }
    
    .l_left .next_prev a.prev{
    display:block;
    height:100%;
    background: red;
    opacity:0.5;
    float:left;
    }
    
    .l_left .next_prev a.next{
    display:block;
    height:100%;
    background: blue;
    opacity:0.5;
    float:right;
    }
</style>
</head>
<body>
<div>
    <a href="#" id="next" style="background-color: red;opacity: 0.4;float: left;position: absolute;">&nbsp;</a>
    <a href="#"id="prev" style="background-color: blue;opacity: 0.4;float: left;position: absolute;">&nbsp;</a>
    <img src="http://files.conceptcarz.com/img/Land%20Rover/range-rover-sport-stormer-edition.jpg" id="obrazek">
</div>
  
  
</body>
</html>
 
$(document).ready(function(){
    var polovina = $("#obrazek").width() / 2;
    var vyska = $("#obrazek").height();
    $("#next").width(polovina).height(vyska);
  $("#prev").width(polovina).height(vyska).css("margin-left", polovina+"px");
  
   $(window).resize(function(){
    var polovina = $("#obrazek").width() / 2;
    var vyska = $("#obrazek").height();
    $("#next").width(polovina).height(vyska);
  $("#prev").width(polovina).height(vyska).css("margin-left", polovina+"px");
  });  
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers