Created
January 30, 2015 18:13
-
-
Save forrestwilkins/7f1ddb377980bb69d6f9 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
$(window).bindWithDelay("scroll", function() { | |
if($(window).scrollTop() + $(window).height() > $(document).height() - 150) { | |
if ($("#more_content_anchor")) { | |
var param = null; | |
if (document.URL.search("users") != -1) { | |
param = $.param({ user_id: document.URL.split("/")[4] }); | |
} else if (document.URL.search("tabs") != -1) { | |
param = $.param({ tab_id: document.URL.split("/")[4] }); | |
} else if (document.URL.search("notes") != -1) { | |
param = $.param({ notes: true }); | |
} | |
if (param) { | |
$.ajax({ | |
type: "GET", | |
url: "/pages/more", | |
data: param | |
}); | |
} | |
} | |
} | |
}, 200); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment