Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DragonI/4982627 to your computer and use it in GitHub Desktop.
Save DragonI/4982627 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var ds_loaded = false, top = $("#disqus_thread").offset().top;
window.disqus_developer = 1;
window.disqus_shortname = 'dragoncrew';
function check(){
if ( !ds_loaded && $(window).scrollTop() + $(window).height() > top ) {
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
cache: true
});
ds_loaded = true;
}
}
$(window).scroll(check);
check();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment