Open Cam opened 8 years ago
You can specify a height in percentage
That doesn't make it responsive, that makes is a % of the container height, whereas the image width is 100% is what dictates its height of auto.
Instead of just height
could you not expose a className
and/or style
?
Is there any solution for this yet? Thanks!
It should take ratio and calculate height based on width of component. Like responsive embed in foundation.
Here is the solution
<LazyLoad className="responsive">
<img src='http://apod.nasa.gov/apod/image/1502/HDR_MVMQ20Feb2015ouellet1024.jpg' alt='' width="1024" height="762" />
</LazyLoad>
.responsive {
position: relative;
height: 0;
padding-bottom: 75%;
overflow: hidden;
}
.responsive iframe,
.responsive object,
.responsive embed,
.responsive video,
.responsive img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Will add to the example.
With the requirement of a fixed height setting, this plugin fails to work inside modern apps where responsive layouts are a standard requirement.