Magnific-Popup icon indicating copy to clipboard operation
Magnific-Popup copied to clipboard

VerticalFIt doesn't take in consideration caption / title

Open matjazu opened this issue 10 years ago • 3 comments

Hey,

first I must say very good job on this jquery plugin :)

I came across a problem where verticalFit doesn't take in consideration caption / title. Therefore i tried with a workaround, but it wasn't what I was looking for. My current workaround works through callback and verticalFit on true.

 callbacks: {
     updateStatus: function(data) {

         if(data.status === 'ready') {
         var imageHeight = parseInt($('.mfp-img').css('max-height'));
         var titleHeight = parseInt($('.mfp-title').height());
         var newHeight = imageHeight-titleHeight;
         $('.mfp-img').css('max-height', newHeight);
         }
      }
 }

But when i change the image in gallery, immediate recalculation of height is visible and image jumps after a few milliseconds.

Is there a better way to recalculate and change max-height so that it will take in consideration also mfp-title but there will be no visible feedback?

matjazu avatar May 19 '15 14:05 matjazu

@matjazu Have you found a solution/fix for this?

chithract avatar Jun 25 '19 07:06 chithract

@chithract I do not remember and I do not find this anywhere in old code. So sry I can not give you any more info regarding this.

matjazu avatar Jun 26 '19 06:06 matjazu

@matjazu I found a solution with https://github.com/dimsemenov/Magnific-Popup/issues/843. Thanks for your reply.

chithract avatar Jun 26 '19 15:06 chithract