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

Inline element sizing issues #10

Open
sjwilliams opened this issue Apr 23, 2014 · 2 comments
Open

Inline element sizing issues #10

sjwilliams opened this issue Apr 23, 2014 · 2 comments

Comments

@sjwilliams
Copy link
Owner

Normally I use this plugin in responsive layouts were images or other lazy loaded elements have rules that make them block elements and inherit a width from their parent:

img.mylazyimage{
  display: block;  
  width: 100%;
}

Without some style rule or content to to give the element the correct size, the sizing logic will fail because laziestloader will miscalculate the target size.

Seems like the plugin should know this case and compensate.

One possible solution could be to checkout display type and temporarily give it the above rules, calculate the width, determine the best image size and then reset the element to its previous state.

This would work in many cases but would fail -- I believe -- if the element's parent also doesn't have a size (like it's position: absolute but without a width)

Ideas to fix this?

@sjwilliams
Copy link
Owner Author

@petulla, what's the "same bit of js handcoding" you're using? I'm not sure I fully follow the solution/non-css workaround you're using.

@petulla
Copy link

petulla commented Apr 26, 2015

Sorry I got this confused with something else I was working on. Loading continues lazily :)

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

No branches or pull requests

2 participants