JavaScriptLazyImage
class JavaScriptLazyImage extends Element (View source)
Properties
protected bool | $isSelfClosing | Whether the element is self closing. |
Methods
No description
Static alias for constructor.
Create an img element wrapped in "". The image will be displayed if JavaScript is disabled.
Create an image element with the image path set to a "data-src" attribute.
Set the image and noscript image fallback "alt" attribute value.
Set the image and noscript image fallback "title" attribute value.
Add one or more CSS classes to the image and noscript image fallback.
Details
__construct($src, $attributes = array(), $lazyLoadNative = false)
No description
static JavaScriptLazyImage
create(string|null $src = false, array $attributes = array(), bool|null $lazyLoadNative = false)
Static alias for constructor.
JavaScriptLazyImage
noscriptFallback(string $src, bool $lazyLoadNative = false)
Create an img element wrapped in "". The image will be displayed if JavaScript is disabled.
Example output:
or
img(string $src, bool $lazyLoadNative = false)
Create an image element with the image path set to a "data-src" attribute.
Example output:
or
alt(string $alt)
Set the image and noscript image fallback "alt" attribute value.
title(string $title)
Set the image and noscript image fallback "title" attribute value.
addClass(string $classes)
Add one or more CSS classes to the image and noscript image fallback.