Pinbox.js is a project mainly written in JavaScript, it's free.
Compare two images
<script src="jquery.js"></script>
<script src="pinbox.js"></script>
<link rel="stylesheet" href="pinbox.css" />
<img />
tag and specify dimensions<img src="images/convent-pano.jpg"
width="940"
height="365"
data-small-src="images/convent-pano-inner.jpg"
data-small-width="507"
data-small-height="264"
data-small-left="163"
data-small-top="11"
class="pinbox"
alt="View from Convent Street"
/>
<script>
jQuery(document).ready(function($) {
$('.pinbox').pinbox();
});
</script>