Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Double Lazy Load for images and background images.
Thanks to jsdelivr, we have CDN link here.
Right here
new dll('selector',callback);
backgroundImage
to elements other than <img>
if they have data-src
attribute.data-src
attribute.Any valid selector or no selector.
new dll('.uniqueClassName'); // lazy loads an element with a given class and it's children if any have data-src
new dll('#uniqueID'); // lazy loads an element with a given ID and it's children if any have data-src
new dll(); // lazy loads any items with data-src from the entire page
If your script is in your site head, you should do this
window.addEventListener('load', loadFunctionExample, false); function loadFunctionExample(){ new dll('[data-src]', myFunction); }
If you want to lazy load on scroll
window.addEventListener('scroll', scrollExample, false); function scrollExample(){ var el = document.getElementById('myItem'); if ( elementInViewport(el) ){ new dll(el, callback) } function callback(){ //do some stuff when loading finished } }
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') }
#License MIT License
FAQs
Double Lazy Load for Images, Videos and Background Images.
The npm package dll.js receives a total of 11 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.