注册 登录 充值会员 退出
毕业设计 PHP源码
充值

jQuery基于EasyHelper分页插件

作者/代码整理:  (转载请附加本文地址,带有“懒人原生”字样的谢绝转载) 发布日期:2018-11-09
jQuery基于EasyHelper分页插件
jQuery基于EasyHelper分页插件是一款内容分页区块功能效果,支持显示总数据量和跳转、默认处于指定页码。


js代码

<script src="js/jquery.min.js"></script>
<script src="js/jquery.transit.min.js"></script>
<script src="js/es6-shim.min.js"></script>
<script src="js/easyhelper.min.js"></script>
<script>

	// 本地模拟的内容生成函数
	var $content = $( ".content" );
	function createContent ( i, index ) {
		$content.eq( index ).empty().html( ('<li>' + i + '</li>').repeat(10) );
	}

	// 调用分页功能 [ 基础版 ]
	Helper.ui.page("#page-1", {
		total: 2000,
		pageSize: 10,
		change: function ( i ) {
			createContent( i, 0 );
		}
	});
	Helper.ui.page("#page-2", {
		total: 2000,
		pageSize: 10,
		showTotal: true,
		change: function ( i ) {
			createContent( i, 1 );
		}
	});
	Helper.ui.page("#page-3", {
		total: 2000,
		pageSize: 10,
		showTotal: true,
		showTo: true,
		change: function ( i ) {
			createContent( i, 2 );
		}
	});
	Helper.ui.page("#page-4", {
		total: 2000,
		pageSize: 10,
		showTotal: true,
		showTo: true,
		currentPage: 25,
		change: function ( i ) {
			createContent( i, 3 );
		}
	});

</script>