@{
ViewBag.Title = " ";
}

<style type="text/css">
#infscr-loading {
text-align: center;
z-index: 100;
position: fixed;
left: 45%;
bottom: 40px;
width: 200px;
padding: 10px;
background: #000;
opacity: 0.8;
color: #FFF;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
</style>
<!-- Begin Small Hero Block -->
@*<section class="hero small accent parallax" style="background-image: url(/images/parallax.png); height:30px">*@
<section class="hero small accent parallax">

<!-- Heading -->
<div class="hero-content container">
<!-- <h1>ITSiteBlog.</h1> -->
<div class="jumbotron" style="background:#2db4d8">
<h1><font color="#fff">Hello, world!</font></h1>
<p>记录Java学习过程的点滴!</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
</div>
<!-- END -->
<!-- Button -->
<div class="sub-hero container">
<!-- <span class="line"></span> -->
</div>
<!-- END -->

</section>
<!-- End Small Hero Block -->
<!-- Begin Blog Block -->
<section class="content container">
<div class="row">

<!-- Begin Posts -->
<div class="col-sm-8">
<!-- Link Post -->
<div id="content">
<h1>Infinite Scroll Testing</h1>
</div>
<a id="next" href="/Home/GetContentList?Catalog=@ViewBag.Catalog&currentPage=2&pageSize=10">next page</a>
</div>
<!-- END -->
<!-- Begin Sidebar -->
<div class="col-sm-4">
<div class="sidebar">

<!-- search widget -->
<div class="widget clearfix">
<form action="#">
<input name="s" id="s" type="text" class="search" placeholder="Search.." value="" />
<input type="submit" value="Go" class="search-submit" />
</form>
</div><!-- END -->
<!-- text widget -->
<div class="widget">
<h5>公告</h5>
<div class="textwidget"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.</p></div>
</div><!-- END -->
<!-- categories widget -->
@if (ViewBag.CatalogList != null && ViewBag.CatalogList.Count > 0)
{
TempData["CatalogList"] = ViewBag.CatalogList;
<div class="widget">
<h5>类别</h5>
<ul>
@for (int i = 0; i < ViewBag.CatalogList.Count; i++)
{
<li class="cat-item"><a href="?Catalog=@ViewBag.CatalogList[i].ID ">@ViewBag.CatalogList[i].Name</a> (3)</li>
}

</ul>
</div><!-- END -->
}
<!-- tagcloud widget -->
<div class="widget">
<h5>标签</h5>
<div class="tagcloud">
<a href='#'>JAVA</a>
<a href='#'>.NET</a>
<a href='#'>云计算</a>
<a href='#'>大数据</a>
<a href='#'>PHP</a>
<a href='#'>数据库</a>
</div>
</div><!-- END -->
<!-- archives widget -->
@*<div class="widget widget-archive">
<h5>点击最多</h5>
<ul>
<li><a href="#">July 2013</a></li>
<li><a href="#">June 2013</a></li>
</ul>
</div>*@<!-- END -->
<!-- recent comments widget -->
<div class="widget widget-recent-comments">
<h5>最新发布</h5>
<ul id="recentcomments">
@for (int i = 0; i < ViewBag.NewContentList.Count; i++)
{
<li class="recentcomments"> <a href="~/Home/article?contentID=@ViewBag.NewContentList[i].ID">@ViewBag.NewContentList[i].Title @ViewBag.NewContentList[i].PostDate </a></li>
}
</ul>
</div><!-- END -->
<!-- recent posts widget -->
<div class="widget widget-recent-entries">
<h5>推荐文章</h5>
<ul>
<li><a href="#" title="Post Title">Standard post with goodies.</a></li>
<li><a href="#" title="Post Title">Fluid video. Yeah we got that.</a></li>
<li><a href="#" title="Post Title">Gallery post with slider.</a></li>
</ul>
</div><!-- END -->
<!-- recent comments widget -->
@*<div class="widget widget-recent-comments">
<h5>最热文章</h5>
<ul id="recentcomments">
<li class="recentcomments">Admin on <a href="#">Standard post with goodies.</a></li>
<li class="recentcomments">Aether-Themes on <a href="#">Fluid video. Yeah we got that.</a></li>
<li class="recentcomments">Admin on <a href="#">Gallery post with slider.</a></li>
</ul>
</div>*@
<!-- END -->
</div>
</div><!-- END -->

</div>
</section>
<!-- End Blog Block -->
<script type="text/javascript">
$(document).ready(function () {
$('#content').infinitescroll({
navSelector: "#next:last",
nextSelector: "a#next:last",
itemSelector: "#content",
debug: true,
extraScrollPx: 20,
dataType: 'json',
loading: {
//加载效果
finishedMsg: 'No more pages to load',
},
maxPage: 3,

template: function (data) {
//data表示服务端返回的json格式数据,这里需要把data转换成瀑布流块的html格式,然后返回给回到函数
 
var content = '';
for (var i = 0; i < data.Data.length; i++) {
content += ' <div class="post link"> '
+ ' <span class="date">30<br><small>Sep</small></span> '
+ ' <span class="date" style="width:63px;height:63px;padding-bottom:0px;border-bottom:0px">'
+ ' <img src="' + data.Data[i].imgUrl + '" style="width:63px;height:63px;padding:0px;border:0px" width="63" height="63" />'
+ ' </span>'
+ ' <div class="post-title">'
+ ' <h2><a href="/Home/article?ID=' + data.Data[i].ID + '">' + data.Data[i].Title + '</a></h2>'
+ ' <div class="post-meta">'
+ ' <h6> 日期:' + data.Data[i].PostDater + ' &nbsp;&nbsp;作者:' + data.Data[i].Poster + '</h6>'
+ ' </div>'
+ ' </div>'
+ ' </div> ';
}
}
return content;
}
 
//,function (newElements) {
// $("#content").prepend(newElements);
//}
);
});
</script>

infinitescroll 通过无限制分页(json方式完整代码)的更多相关文章

  1. python实现邮件发送完整代码(带附件发送方式)

    实例一:利用SMTP与EMAIL实现邮件发送,带附件(完整代码) __author__ = 'Administrator'#coding=gb2312 from email.Header import ...

  2. Android+struts2+JSON方式的手机开发(Login)

    在手机的后台服务无论是调用WebService还是Http请求,多数都是采用Android的HttpClient实现相关的调用实现.本文实现Android+Struts2+JSON方式实现为手机前台提 ...

  3. 单点登录(十三)-----实战-----cas4.2.X登录启用mongodb验证方式完整流程

    我们在之前的文章中中已经讲到了正确部署运行cas server 和 在cas client中配置. 在此基础上 我们去掉了https的验证,启用了http访问的模式. 单点登录(七)-----实战-- ...

  4. 实战SpringCloud响应式微服务系列教程(第十章)响应式RESTful服务完整代码示例

    本文为实战SpringCloud响应式微服务系列教程第十章,本章给出响应式RESTful服务完整代码示例.建议没有之前基础的童鞋,先看之前的章节,章节目录放在文末. 1.搭建响应式RESTful服务. ...

  5. 使用Express连接mysql详细教程(附项目的完整代码我放在结尾了)

    使用Express连接mysql详细教程(附项目的完整代码我放在结尾了) 要使用Express连接本地数据库 我们首先需要安装好Express的依赖 我们使用这个框架呢首先要有一点ajax的基础 如果 ...

  6. 使用 ServiceStack.Text 序列化 json的实现代码【转】

    转自:http://www.jb51.net/article/38338.htm 今天发篇文章总结下自己使用 ServiceStack.Text 来序列化 json.它的速度比 Newtonsoft. ...

  7. json方式封装接口通信

    编写response类: <?php class response{ /** * 按json方式输出通信数据 * @param integer $code 状态码 * @param string ...

  8. Jquery发送ajax请求以及datatype参数为text/JSON方式

    Jquery发送ajax请求以及datatype参数为text/JSON方式 1.方式一:datatype:'text' 2.方式二:datatype:'JSON' 3.使用gson-1.5.jar包 ...

  9. wemall app商城源码中基于JAVA通过Http请求获取json字符串的代码

    wemall-mobile是基于WeMall的Android app商城,只需要在原商城目录下上传接口文件即可完成服务端的配置,客户端可定制修改.分享其中关于通过Http请求获取json字符串的代码供 ...

随机推荐

  1. ActionScript 3.0日期与时间管理(Date类)

    ,6)); var now_1:Date=new Date(); trace(now_1.getHours());    /*输出结果会根据设置和测试时间不同而有                    ...

  2. 使用easy_install安装numpy、pandas、matplotlib及各种第三方模块

    倒腾了一晚上最终把题目中的环境配好了.以下简要说明.留作资料.并共享. 1.安装python. 在cmd中能进入python环境,通过把python路径加入到系统路径中就可以实现. 2.安装easy- ...

  3. OpenGL蓝宝书第五章代码勘误以及惯性坐标系去解释模型变换:Pyramid.cpp

    假设你也发现依照教程代码完毕贴图时,你会底面的坐标和寻常顶点坐标正负相反,比方-1.0f, -1.0f, -1.0f这个顶点相应的却是世界坐标中1.0f,-1.0f,1.0f 问题到底出如今哪里? 原 ...

  4. [PWA] 13. New db and object store

    Create a db: import idb from 'idb'; var dbPromise = idb.open('test-db', 2, function (upgradeDb) { sw ...

  5. [Javascript] Grouping and Nesting Console Log Output

    Organize your log output by grouping your logs into collapsable hierarchies using console.group(). ; ...

  6. Java POI导入Excel文件

    今天在公司需要做个导入Excel文件的功能,所以研究了一下,参考网上的一些资料总算是做出来了,在此记录一下防止以后忘记怎么弄. 本人用的是poi3.8,所以需要的JAR包如下: poi-3.8.jar ...

  7. common-httpclient 用户名密码认证示例

    import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.com ...

  8. [转] 关于c++的头文件依赖

    http://www.cnblogs.com/yvesliao/p/3938730.html PS: 使用单向依赖 正在看google c++编程规范,里面对头文件依赖是这么说的: 1 2 3 4 5 ...

  9. Python | 基础系列 · Python为什么没有switch/case语句?

    与我之前使用的所有语言都不同,Python没有switch/case语句.为了达到这种分支语句的效果,一般方法是使用字典映射: def numbers_to_strings(argument): sw ...

  10. 使用MWC四轴起飞侧翻解决方法

    原因如下:1.电机顺序错了,如上图所示,上面蓝色的箭头是机头,绿色的箭头是电机转向,3.10.11.9对应MWC飞控版上的D3,D9,D11,D9,蓝色箭头对应MWC飞控板的箭头 或者传感器的Y轴 以 ...