Skip to content

Instantly share code, notes, and snippets.

@songjiayang
Last active December 20, 2015 09:49
Show Gist options
  • Save songjiayang/6110508 to your computer and use it in GitHub Desktop.
Save songjiayang/6110508 to your computer and use it in GitHub Desktop.
a rails code for infinitescroll
coffee:
$wrapper = $('.js-infinitescroll-wrap')
$wrapper.find('.feed-paging nav.pagination').hide()
$wrapper.infinitescroll
navSelector: "nav.pagination"
nextSelector: "nav.pagination .next a"
itemSelector: ".js-infinitescroll-item"
bufferPx: 150
loading:
img: "/assets/spinner.gif"
msgText: "<em>#{__("Loading...")}</em>"
finishedMsg: "<em>#{__("No more pages")}</em>"
(elements) ->
$wrapper.append($(elements))
true
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment