Skip to content

Inline element sizing issues #10

@sjwilliams

Description

@sjwilliams

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions