-1
我有一个html文档,但它的大小约为5MB。使用jquery和mvc分页重文档
这里是我的代码” ../Product/index?page=1" 它生成HTML 5MB:
插件网址:http://andersonferminiano.com/jqueryscrollpagination/
<script type="text/javascript">
$(function() {
$('#content').scrollPagination({
'contentPage': '../Product/index?page=1',
'contentData': {},
'scrollTarget': $(window),
'heightOffset': 10,
'beforeLoad': function() {
$('#loading').fadeIn();
},
'afterLoad': function (elementsLoaded) {
$('#loading').fadeOut();
var i = 0;
$(elementsLoaded).fadeInWithDelay();
if ($('#content').children().size() > 100) {
$('#nomoreresults').fadeIn();
$('#content').stopScrollPagination();
}
}
});
$.fn.fadeInWithDelay = function() {
var delay = 0;
return this.each(function() {
$(this).delay(delay).animate({ opacity: 1 }, 200);
delay += 100;
});
};
});
</script>
<!--_____________________________________________________________________-->
@{
// here is "Product/index" Code
if (Request.QueryString.HasKeys())
{
int iPage = Request.QueryString["page"].AsInt();
using (var db = new PNUBOOKIR.Models.KowsarSiteEntities())
{
var queries = from n in db.vwGood
select n;
long counter = 0;
for (int i = 1; i <= iPage; i++)
{
foreach (var q in queries)
{
counter++;
<li style="opacity: 0; -moz-opacity: 0; filter: alpha(opacity=0);">
<p>
@counter
</p>
</li>
}
}
}
}
}
我不希望加载它完成时滚动下来它应该加载10个其他“李”元素
我想你忘了问题 – 2011-05-15 11:00:04
对不起,我忘记了。 – kamiar3001 2011-05-15 11:09:39