bootstrap新闻模块样式模板

时间:2024-01-17 09:42:50
 <!--  news beginning -->
<div class="container mp30">
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<span class="glyphicon glyphicon-list-alt"></span><b>新闻</b></div>
<div class="panel-body">
<div class="row">
<div class="col-xs-12">
<ul class="demo1" id="news1"> </ul>
</div>
</div>
</div>
<div class="panel-footer"> </div>
</div>
</div> <div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<span class="glyphicon glyphicon-list-alt"></span><b>新闻</b></div>
<div class="panel-body">
<div class="row">
<div class="col-xs-12">
<ul class="demo2" id="news2"> </ul>
</div>
</div>
</div>
<div class="panel-footer"> </div>
</div>
</div> <div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<span class="glyphicon glyphicon-list-alt"></span><b>新闻</b></div>
<div class="panel-body">
<div class="row">
<div class="col-xs-12">
<ul class="demo2" id="news3"> </ul>
</div>
</div>
</div>
<div class="panel-footer"> </div>
</div>
</div>
</div>
</div> <!-- end news -->
_________________________________________________
var s = "";
var f= "";
var g=""; $.each(response, function(index, value) {
s+='<li class="news-item">';
s+='<table cellpadding="4">';
s+='<tr>';
s+='<td><a href="'+basePath+'ajax/news-show.jsp?entity.id='
+ value.id + '">'+value.title+'</a></td>';
s+='</tr></table></li>';
if(index==9)
return false;
})
$("#news1").append(s);
$.each(response, function(index, value) {
if(index<=9)
{}
else
{
f+='<li class="news-item">';
f+='<table cellpadding="4">';
f+='<tr>';
f+='<td><a href="'+basePath+'ajax/news-show.jsp?entity.id='
+ value.id + '">'+value.title+'</a></td>';
f+='</tr></table></li>';
if(index==20)
return false;
} })
$("#news2").append(f);
$.each(response, function(index, value) {
if(index<=20){}
else
{
g+='<li class="news-item">';
g+='<table cellpadding="4">';
g+='<tr>';
g+='<td><a href="'+basePath+'ajax/news-show.jsp?entity.id='
+ value.id + '">'+value.title+'</a></td>';
g+='</tr></table></li>';
if(index==30)
return false;
} })
$("#news3").append(g);