Forked from kirbysayshi/jquery-lazy-load-discus-comments.js
Created
May 15, 2016 16:34
-
-
Save kkrico/cd62f2129b9a14bc9348b08b755a5853 to your computer and use it in GitHub Desktop.
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(function(){ | |
var ds_loaded = false, top = jQuery("h1:contains(Comments)").offset().top; | |
function check(){ | |
if ( !ds_loaded && jQuery(window).scrollTop() + jQuery(window).height() > top ) { | |
jQuery.getScript("http://jquery.disqus.com/disqus.js?v=2.0&slug=add&pname=wordpress&pver=2.12"); | |
ds_loaded = true; | |
} | |
} | |
jQuery(window).scroll(check); | |
check(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment