• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

pklauzinski/jscroll: An infinite scrolling plugin for jQuery.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

pklauzinski/jscroll

开源软件地址:

https://github.com/pklauzinski/jscroll

开源编程语言:

JavaScript 100.0%

开源软件介绍:

jScroll - jQuery Plugin for Infinite Scrolling / Auto-Paging

Build Status npm version Bower version Join the chat at https://gitter.im/pklauzinski/jscroll

Official site at jscroll.com.

Requires jQuery v1.8.0+

Facebook Page

Follow us on Facebook for commit updates: https://www.facebook.com/jScroll.Infinite.Scrolling

Usage

The jscroll method is called on the selector for which you want your scrollable content contained within. For example:

$('.jscroll').jscroll();

The jscroll method takes an optional object literal as a parameter for overriding the default options. An example of how this can be done is shown below.

$('.jscroll').jscroll({
    loadingHtml: '<img src="loading.gif" alt="Loading" /> Loading...',
    padding: 20,
    nextSelector: 'a.jscroll-next:last',
    contentSelector: 'li'
});

Options

  • debug (false) - When set to true, outputs useful information to the console display if the console object exists.
  • autoTrigger (true) - When set to true, triggers the loading of the next set of content automatically when the user scrolls to the bottom of the containing element. When set to false, the required next link will trigger the loading of the next set of content when clicked.
  • autoTriggerUntil (false) - Set to an integer greater than 0 to turn off autoTrigger of paging after the specified number of pages. Requires autoTrigger to be true.
  • loadingHtml ('<small>Loading...</small>') - The HTML to show at the bottom of the content while loading the next set.
  • loadingFunction (false) - A JavaScript function to run after the loadingHtml has been drawn.
  • padding (0) - The distance from the bottom of the scrollable content at which to trigger the loading of the next set of content. This only applies when autoTrigger is set to true.
  • nextSelector ('a:last') - The selector to use for finding the link which contains the href pointing to the next set of content. If this selector is not found, or if it does not contain a href attribute, jScroll will self-destroy and unbind from the element upon which it was called.
  • contentSelector ('') - A convenience selector for loading only part of the content in the response for the next set of content. This selector will be ignored if left blank and will apply the entire response to the DOM.
  • pagingSelector ('') - Optionally define a selector for your paging controls so that they will be hidden, instead of just hiding the next page link.
  • callback (false) - Optionally define a callback function to be called after a set of content has been loaded.

For more information on the contentSelector option and how it loads a response fragment, see the jQuery documentation for the .load() method.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

LICENSES:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap