GoogleChromeLabs / wp-native-lazyload

WordPress plugin to lazy-load media using the native browser feature.
https://wordpress.org/plugins/native-lazyload/
Apache License 2.0
51 stars 13 forks source link

Anchor link is misaligned #15

Open childsview opened 4 years ago

childsview commented 4 years ago

There is a problem with pages that use anchor links. If an anchor link is set at the top of the page and an image is included in the page, the anchor link will deviate from the target id. This is because the height of the image is calculated while moving by lazyload.

Is there a way to solve this?

I can skip lazyload only for that page, but it’s a bit cumbersome. Is there any good way?

Issue Overview

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Expected Behavior

Current Behavior

Possible Solution

Screenshots / Video

Related Issues and/or PRs

felixarntz commented 4 years ago

@childsview Thanks for the report!

I'm not sure whether it's possible to solve this without a framework. Any resources that aren't immediately visible can't be easily layouted unless accurate attributes to describe the layout are present, e.g. width and height. A framework like AMP can help with this, but I think this isn't something that can be fixed in the scope of this plugin unfortunately.