
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Create lazy loading request or element like image, iframe, video... Make custom animation on lazy and not lazy element on all browser. You can also use our animations included in the lib. All of that just with html attributes.
Create lazy loading request or element like image, iframe, video... Make custom animation on lazy and not lazy element on all browser. You can also use our animations included in the lib (Demo). All of that just with html attributes.
<img lazy-src="https://picsum.photos/300/300?random=1" lazy-srcset="https://picsum.photos/300/300?random=2 900w" lazy-animation="corner-top-left" lazy-reset>
import lazyattr from "lazy-attr";
import "lazy-attr/dist/lazy-attr-animation.css";
//Vue.use(lazyattr)
<script src="https://unpkg.com/lazy-attr@1.2.3/dist/lazy-attr.js" type="text/javascript"></script>
<link href="https://unpkg.com/lazy-attr@1.2.3/dist/lazy-attr-animation.css" rel="stylesheet"/>
<script src="./dist/lazy-attr.js" type="text/javascript"></script>
<link href="./dist/lazy-attr-animation.css" rel="stylesheet"/>
lazy-loaded
When the element is matchedlazy-quit
When the element is not matched<div id="cars" lazy-observe></div>
document.querySelector('#cars').addEventListener('lazy-loaded', function(event){
const target = event.target;
target.textContent = "Hey I'm lazy";
});
lazyattr
wich be transform in lazyloaded
after the element is loaded (work on the pointer and parent)lazy-skeleton
, lazy-skeleton-corner
and lazy-skeleton-top
classlazy-animation-pointer="#parent"
on the image to remove it after load.lazy-background
will automatically remove it after load.Parameters | Usage |
---|---|
lazy-observe | Just observe the element to do lazy request for example |
lazy-reset | Reset the animation on scroll |
lazy-srcset | Same as srcset attribute |
lazy-src | Image soucre | iframe source | video source |
lazy-background | Image source to make a lazy background image |
lazy-size-width | Minimum width size |
lazy-size-height | Minimum height size |
lazy-animation | Animation to lauch after full load of element |
lazy-animation-time | Animation duration (time in ms) |
lazy-animation-delay | Animation delay (time in ms) |
lazy-animation-pointer | Wich element will be animated after the lazy element is load (expl: "#id", ".class", "tag") |
lazy-animation-function | Animation timing function like css |
lazy-animation-count | Animation repeatition like css (expl: infinite) |
Parameters | Usage |
---|---|
lazy-video | Put a poster while user dont click on the video |
Parameters | Usage |
---|---|
lazy-embed | Iframe link |
lazy-poster | Put a poster while user dont click on the video |
Parameters | Usage |
---|---|
version | Get actual version of lazy-attr |
parameters | Get all possible attributes of lazy-attr |
animations | Get all animations |
<img lazy-src="..." lazy-srcset="..." lazy-animation="corner-top-left">
zoomin
zoomout
opacity
slide-left
slide-right
slide-bottom
slide-top
corner-top-left
corner-top-right
corner-bottom-left
corner-bottom-right
shake
rotate
blur
flip
flip-up
.my-name{
opacity: 0;
animation: animation-name 1s forwards;
}
@keyframes animation-name{
100%{
opacity: 1;
}
}
:root{
--slide-start: 33%;
--slide-velocity: 7px;
--scale-velocity: 0.035;
--scale-start: 0.4;
}
1.2.3
lazy-size-width
and lazy-size-height
FAQs
Create lazy loading request or element like image, iframe, video... Make custom animation on lazy and not lazy element on all browser. You can also use our animations included in the lib. All of that just with html attributes.
The npm package lazy-attr receives a total of 5 weekly downloads. As such, lazy-attr popularity was classified as not popular.
We found that lazy-attr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.