matt-barker
2/3/2017 - 3:57 PM

Zoom

Zoom

<script>
$(document).ready(function() {
$('.summary-thumbnail').addClass('thumb-show');
var src = $('.thumb-show').find('img').attr("src");

  $('.thumb-show').append('<img class="zoom" src="'+src+'" >');

$('.thumb-show').mouseenter(function(){
  console.log(src)
    $(this).mousemove(function(event){
      
        var offset = $(this).offset();
        var left = event.pageX - offset.left;
        var top = event.pageY - offset.top;
      
        $(this).find('.zoom').css({
          width: '200%',
          opacity: 1,
          left: -left,
          top: -top
        })
    });
});

$('.thumb-show').mouseleave(function(){                     
   $(this).find('.zoom').css({
     width: '100%',
     opacity: 0,
     left: 0,
     top: 0
   })                               
 });

});
</script>