Backdrop is a simple JavaScript module to preload an image and gracefully apply it as the background of a node in the page. There are three parameters in the object's constructor configuration, although only the first is required:
nodesrc | srcsetid (optional)`backdrop` if none provided)styles (optional)position, repeat, size) and the respective values that should be applied to the backdropThree custom events are fired:
startenderrorAn example implementation follows:
var dropper = new Backdrop({}); drop.on('end', function(url) { window.console.log('dropped', url); }); dropper.drop({srcset: 'https://path/to/image.jpg'});