
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Double Lazy Load for Images, Videos and Background Images.
Double Lazy Load for videos, images and background images. Sourced with ES6+ and strong TypeScript definitions.
Right here. Also provides some tips on how to use.
npm install dll.js
new dll('selector',callback);
data-src
, orbackgroundImage
to elements other than <img>
if they have data-src
attribute.<video>
elements having <source>
with data-src
attributedata-src
attribute.Any valid selector or no selector.
// lazy loads an element with a given class and it's children if any have data-src
new dll('.uniqueClassName', callBack);
// lazy loads an element with a given ID and it's children if any have data-src
new dll('#uniqueID', callBack);
// lazy loads any items with data-src from the entire page
new dll();
If you want to lazy load on scroll, with isElementInViewport you can do:
// your target element
var el = document.getElementById('myItem');
// the callback
function callback(){
//do some stuff when loading finished
}
// the scroll eventHandler
function scrollHandler(){
if ( isElementInViewport(el) ){
new dll(el, callback)
}
window.removeEventListener('scroll', scrollHandler, false);
}
window.addEventListener('scroll', scrollHandler, false);
Lazy load a parent <div id="myElement" data-src="..image.png">
with many elements inside subject to dll.js object:
var el = document.getElementById('myElement'); //this is a parent
new dll(el, callback)
function callback(){
console.log('I just finished lazy loading the last element for #myElement')
}
FAQs
Double Lazy Load for Images, Videos and Background Images.
The npm package dll.js receives a total of 0 weekly downloads. As such, dll.js popularity was classified as not popular.
We found that dll.js 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
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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.