Skip to content

Instantly share code, notes, and snippets.

@CaiJimmy
Created January 20, 2017 23:49
Show Gist options
  • Save CaiJimmy/fbbd1e3a8413679303b019ba9e9f7636 to your computer and use it in GitHub Desktop.
Save CaiJimmy/fbbd1e3a8413679303b019ba9e9f7636 to your computer and use it in GitHub Desktop.
Ghost Lazyload images
<section class="post-content">
<noscript>{{content}}</noscript>
</section>
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