文章标签 ‘jQuery’
JsTree Demo Version: jstree pre 1.0 stable Old versions: http://code.google.com/p/jstree/downloads/list Add a demo for jstree in demo/index.html Integrate the usage of metadata, click the node event ,attrs,toggle nodes and ajax json in jstree Changed apple theme and classic theme background fixed for in ie6. 1. ?View Code HTML<script type="text/javascript" src="./_lib/jquery.js"></script> <script type="text/javascript" src="./jquery.jstree.js"></script> 2. ?View [...]
这里介绍一个Jquery 的pager插件,相信会有很多人需要他,具体参考http://www.j-dee.com/2008/12/22/jquery-pager-plugin/ 你可以从这里查询他是如何工作的,以及一个简单的demo http://jonpauldavies.github.com/JQuery/Pager/PagerDemo.html 到这里去下载它http://github.com/jonpauldavies/jquery-pager-plugin/tree/master 我的使用经验: 使用非常简单,你之需要为它定义记录的总页数(或你想显示的页数),当前页码,以及一个当你点击页码时触发的回调函数。 ?View Code JAVASCRIPTSample: /** * 调用$.ajax请求获取Comment记录; * 请求参数是(当前页,每页记录数,查询条件…); * 返回(Comment记录,当前页,总页数) **/ function getComment(){ … } /** *通过JS重绘页面 *重绘pager DIV * **/ function showComment(){ … $("#pager").pager({ pagenumber: currentPage, pagecount: pageCount, buttonClickCallback: PageClick }); PageClick = function(pageclickednumber) { getComment(pageclickednumber); } } PageClick 就是我们定义的回调函数,当点击页码的时候请求数据. 另外他还可以自定义样式,你可以像下面这样去自定义它的显示: ?View [...]
