Created
March 22, 2019 08:54
-
-
Save shanejones/ccbdee451375f4bda0f1f55e6bb0f54c to your computer and use it in GitHub Desktop.
For lazy loading favicons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
/** | |
* Add class of ll to each favicon link you want to lazy load | |
* Also change the href to data-href and the below script will do the rest | |
* | |
* @type {*|jQuery|HTMLElement} | |
*/ | |
var links = $('link.ll'); | |
links.each(function() { | |
var href = $( this ).attr( 'data-href' ); | |
$( this ).attr( 'href', href ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment