1.1.3
- Added: event handler based fallback (
click
,mouseover
etc.)
Optional config:
{"events": ["click"]}
Also available as compressed array index 4
.
The event handler based fallback enables to trigger the observer callback using an event handler when the observer fails.
This feature enables to show a user friendly placeholder using CSS and SVG.
img[data-src] {
background-image: url(placeholder.svg);
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
background-color: #f9f9f9;
cursor: context-menu;
}
img[data-src]:hover {
background-color:#efefef;
}
Result: