Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Double Lazy Load for videos, images and background images.
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 elementInViewport 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 ( elementInViewport(el) ){
new dll(el, callback)
}
}
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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.