项目作者: donwalter

项目描述 :
jQuery Mobile LazyLoad - LazyLoad/Infinite Scrolling plugin for jQuery Mobile listviews
高级语言:
项目地址: git://github.com/donwalter/jquery-mobile-lazyload.git
创建时间: 2013-06-28T12:45:31Z
项目社区:https://github.com/donwalter/jquery-mobile-lazyload

开源协议:

下载


jQuery Mobile LazyLoad

jQuery Mobile LazyLoad - LazyLoad/Infinite Scrolling plugin for jQuery Mobile listviews, uses Ajax for pulling in more records

Usage

Include the following file:

  1. <script type="text/javascript" src="js/jquery-mobile-lazyload.js"></script>

Your listview will consist of 2 parts… the <ul> tag, and an include file (getdata.cfm) that generates the <li> elements
List file:

  1. <ul data-role="listview" id="dataList" class="lazyload">
  2. <cfinclude template="getdata.cfm" ></cfinclude>
  3. </ul>

Include file (getdata.cfm):

  1. <cfsetting showdebugoutput="false">
  2. <cfparam name="url.startrow" default="1">
  3. <cfparam name="url.maxrows" default="20">
  4. <cfset variables.results = objMobile.GetDataList(parameters)>
  5. <cfset variables.inc = url.startrow + 1>
  6. <cfoutput query="variables.results" startrow="#url.startrow#" maxrows="#url.maxrows#">
  7. <li data-inc="#variables.inc#">
  8. <a href="details.cfm?#variables.results.dataid#">
  9. #variables.results.display#
  10. </a>
  11. </li>
  12. <cfset variables.inc++>
  13. </cfoutput>

Then add this to initiate the LazyLoad:

  1. $(function(){
  2. $('.lazyload').lazyLoad('getdata.cfm');
  3. });

Demo

License

Copyright (c) 2013 Don Walter. Licensed under the MIT license.