cbopp-art / lightcase

The smart and flexible Lightbox Plugin.

Home Page:https://cornel.bopp-art.com/lightcase/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maxWidth: 1280 image is still inside a 800px box

al404 opened this issue · comments

commented

I would like to see less padding around my image
With no settings the image is opened at 800px
I try to add maxWidth: 1280 but doesn't seem to get bigger, I'm using a retina iMac not sure if this can influence image size

I also tried

$('a[data-rel^=lightcase]').lightcase({ maxWidth: 1280, maxHeight: 900, forceWidth: true, forceHeight: true });

but still doesn't work

According to your settings, it should work.
How large is your image effectively (in natural)?

Btw: You don't need forceWidth/forceHeight because they only make sense in combination with the settings width/height but not maxWidth/maxHeight.

commented

in my case image size is 1280 x 900

I made a codepen example with real image 1920 x 1280
codepen example
how I see it

Any fix on this? I also use the very simple way of Lightcase with a <a> tag as an image wrapper but the popup does not appears wider that 800px.

Maybe it is the maxHeight which gives you the size limit. So, just try to set more maxHeight.

I use this code:

$('a[data-rel^=lightcase]').lightcase({
  showSequenceInfo: false,
  showTitle: false,
  maxWidth: 1920,
  maxHeight: 1080
});

But I still got 800x500 as I can see with dev tools on Chrome.

I found the solution. I have to use both maxWidth and maxHeight together with iframe object because I use Placehold.it service as image holder. So Lightcase thinks that I point to a URL instead of an image file so it returns an iframe, instead of an image.

@akkis Ok. Another better approach in you case is to force the type image. I think it should suffice.

{
  type: 'image'
  ...
}

Yeap, this is way better solution :) Thank you for this great library BTW.

Thanks for the solution boys, i was having the same problem.