elevateweb / elevatezoom

1.02k stars 493 forks source link

Image container size is larger than image orignal size. #165

Open affan00 opened 7 years ago

affan00 commented 7 years ago

I am using elevate zoom on one of my projects, It works fine when the image size is greater than image container size but it's not working fine if image original size is less than image container size. Here is my code

onClickSnapshotMagnifier = ->

  $('#snapshot-magnifier').on 'click', ->

    $('.zoomContainer').remove()

    if $('.enabled').length == 0

      $('#imgPlayback').elevateZoom

        responsive: true,

        zoomType: "inner",

        cursor: "crosshair",

        scrollZoom: true

      $(this).toggleClass 'enabled'

    else

      $(this).toggleClass 'enabled'

      $('.zoomContainer').hide()

"#snapshot-magnifier" is the id of the button for activate/deactivate elevate zoom. Here is the snapshot if the image size is less than container size. image