Skip to content

Instantly share code, notes, and snippets.

@AaronLayton
Created November 14, 2018 09:23
Show Gist options
  • Save AaronLayton/26317ac14c3bcdceaa80b33e354ca4aa to your computer and use it in GitHub Desktop.
Save AaronLayton/26317ac14c3bcdceaa80b33e354ca4aa to your computer and use it in GitHub Desktop.
Highlight all lazyloaded `data-src` images
$('[data-src]').wrap($('<div />').addClass('preload-highlighter'));
$('body').append(`
<style>
.preload-highlighter { position: relative; }
.preload-highlighter:after {
content: '';
display: block;
position: absolute;
top:0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255,0,0,.2);
border: 1px solid #f00;
}
</style>
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment