Linux 软件免费装
Banner图

Lazy Loader

开发者 FlorianBrinkmann
更新时间 2024年4月14日 20:40
捐献地址: 去捐款
PHP版本: 7.0 及以上
WordPress版本: 6.5

标签

performance images lazy loading lazysizes

下载

5.0.0 3.1.0 3.4.0 6.0.1 1.0.7 1.0.8 1.0.9 3.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.5.0 3.5.1 4.0.0 5.1.0 5.1.2 6.0.0 7.0.0 7.1.0 7.2.0 7.2.1 7.2.2 7.2.3 8.0.0 1.0.1 1.0.4 1.0 1.0.2 1.0.3 1.0.5 1.0.6 3.1.7 3.2.7 4.0.1 4.1.0 5.1.1 8.1.0 8.1.1 8.2.0

详情介绍:

Lazy loading plugin that supports images, iFrames, video and audio elements and uses the lightweight lazysizes script. With manual modification of the markup it is also possible to lazy load background images, scripts, and styles. Lazy loads (without the need of any manually modifications): * Can be enabled in the plugin options. The plugin comes with the following options (under Settings › Media › Lazy Loader options): * The unveilhooks extension of lazysizes supports more than video and audio elements, but you need to manually modify the markup to use it for: The plugin adds a noscript element as fallback for disabled JavaScript (can be disabled with the lazy_loader_generate_noscript filter). You can disable lazy loading for elements with specific CSS classes by defining them via the plugin settings (SettingsMediaLazy Loader options). Or use the skip-lazy class or the data-skip-lazy attribute. skip-lazy and data-skip-lazy also work on wrapper elements to exclude the wrapper and its children from being processed.

安装:

常见问题:

Is there a way to manually call the plugin to modify markup of not-supported image functions?

Yes. See the following example that would generate lazy-load-ready output for the result of the not-supported wp_get_attachment_image() function: global $lazy_loader; if ( isset( $lazy_loader ) && $lazy_loader instanceof FlorianBrinkmann\LazyLoadResponsiveImages\Plugin ) { echo $lazy_loader->filter_markup( wp_get_attachment_image( 1261 ) ); } To make it happen, you need to pass the markup that contains the image (or images) to $lazy_loader->filter_markup(). The if statement ensures that the Lazy Loader object is there and that it is an object of the correct class.

How can I disable/modify the inline styles?

Important: If you modify or remove the inline styles, also the style that shows the loading spinner is affected. So if you remove the styles or modify them without adding back the spinner styles, the spinner option will not work. I created a Gist with the spinner styles – just add them to your modification to make it work. To disable or modify the plugin’s inline styles (except the style that hides the img.lazyload elements when JS is disabled, so only the noscript version is displayed) you can use the lazy_load_responsive_images_inline_styles filter. For example, to remove the inline styles, use the following code: add_filter( 'lazy_load_responsive_images_inline_styles', function () { return ''; } ); If you want to modify it, you can do that like in the following code block (remember to include the opening and closing style tags for additions/replacements). The code modifies the duration of the fade-in-effect: ` add_filter( 'lazy_load_responsive_images_inline_styles', function ( $default_styles ) { $default_styles = sprintf( '%s :root { --lazy-loader-animation-duration: 600ms; }', $default_styles ); return $default_styles; } ); The CSS from the example are the default styles that are used by the plugin (without the loading spinner styles). Thedisplay: blockfor.lazyload` is important for the aspectratio plugin option.

How can I adjust the lazy load threshold/other lazysizes settings?

There is a textarea in the plugin settings where you can insert custom settings for the lazysizes config.

更新日志:

8.2.0 – 14.04.2024 Tested with WordPress 6.5. Added Fixed 8.1.1 – 20.12.2022 Tested with WordPress 6.1. Fixed 8.1.0 – 29.03.2021 Added 8.0.0 – 22.03.2021 Removed 7.2.3 – 17.03.2021 Fixed 7.2.2 – 17.03.2021 Fixed 7.2.1 – 09.03.2021 Fixed 7.2.0 – 08.03.2021 Tested with WordPress 5.7. Added Changed Fixed 7.1.0 – 04.11.2020 Changed Fixed 7.0.0 – 10.08.2020 If you depend on the aspectratio script of lazysizes somehow that came with the plugin, this release has a breaking change: it removes the aspectratio option (and the script) because it uses inline SVGs as placeholders that have the same effect without needing the aspectratio script. Added Changed Fixed Removed 6.0.1 – 01.05.2020 Changed 6.0.0 – 31.01.2020 This release requires PHP 7 Added Changed Fixed 5.1.2 – 12.11.2019 Changed 5.1.1 – 11.11.2019 Changed 5.1.0 – 11.11.2019 Added Changed Fixed 5.0.0 – 28.06.2019 Changed Fixed 4.1.0 – 31.05.2019 Tested with WordPress 5.2 Added Changed Fixed 4.0.1 – 20.02.2019 Fixed 4.0.0 – 20.02.2019 Tested with WordPress 5.1. Changed 3.5.1 – 28.01.2019 Fixed 3.5.0 – 28.01.2019 Added Changed Fixed 3.4.0 – 05.07.2018 Added Fixed 3.3.7 – 12.06.2018 Fixed 3.3.6 – 11.06.2018 Changed Fixed 3.3.5 – 14.04.2018 Fixed 3.3.4 – 05.04.2018 Fixed Changed 3.3.3 – 13.03.2018 Fixed 3.3.2 – 09.03.2018 Fixed 3.3.1 – 09.03.2018 Fixed 3.3.0 – 09.03.2018 (there was also a new feature added in 3.2.9, but I forgot to increase the minor version number there…) Added Changed Fixed 3.2.10 – 06.03.2018 Fixed 3.2.9 – 06.03.2018 Added 3.2.8 – 27.02.2018 Fixed 3.2.7 – 22.02.2018 Added Fixed 3.2.6 – 30.11.2017 Changed 3.2.5 – 27.11.2017 Fixed 3.2.4 – 25.11.2017 Fixed 3.2.3 – 25.11.2017 Fixed 3.2.2 – 25.11.2017 Fixed 3.2.1 – 25.11.2017 Fixed 3.2.0 – 25.11.2017 Added Changed Fixed 3.1.13 – 08.11.2017 Changed 3.1.12 – 22.09.2017 Fixed 3.1.11 – 19.09.2017 Changed Fixed Removed 3.1.10 – 17.09.2017 Fixed 3.1.9 – 25.08.2017 Fixed 3.1.8 – 10.08.2017 Fixed 3.1.7 – 10.08.2017 Fixed 3.1.6 – 07.08.2017 Fixed 3.1.5 – 20.07.2017 Fixed 3.1.4 – 14.07.2017 Fixed 3.1.3 – 07.07.2017 Fixed 3.1.2 Fixed 3.1.1 Changed Fixed 3.1.0 Added Changed 3.0 1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2