Created
January 20, 2017 23:49
-
-
Save CaiJimmy/fbbd1e3a8413679303b019ba9e9f7636 to your computer and use it in GitHub Desktop.
Ghost Lazyload images
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
var lazyloadImg = function() { | |
var a = $(".post-content noscript"), | |
b = a.text(), | |
c = b.replace(/img src=/g, "img data-original="); | |
$(".post-content").append(c); | |
$(".post-content img").lazyload(); | |
}; | |
lazyloadImg(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment