Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't show images on ios. #5

Closed
daniymilner opened this issue Oct 21, 2014 · 1 comment
Closed

can't show images on ios. #5

daniymilner opened this issue Oct 21, 2014 · 1 comment

Comments

@daniymilner
Copy link

Hi, I have a problem with images on ios. Images has with width=1px height=0px. I can resolve it with getting height and width on image.onload in lightboxSrc directive.

was

var image = new Image();
image.src = src;

// these variables must be set before resize(), as they are used in it
imageWidth = image.naturalWidth;
imageHeight = image.naturalHeight;

resize();

I do

var image = new Image();
image.src = src;
image.onLoad = function(){
    imageWidth = image.naturalWidth;
    imageHeight = image.naturalHeight;
    resize();
};

it's work, but I don't know, is it good solution.

@compact
Copy link
Owner

compact commented Oct 27, 2014

That is a good solution. I replicated and fixed this problem in iOS 8.1 Chrome 38 (the problem didn't appear in Safari).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants