开发 页面 分页模板

<form action="ad/gift!list.action" method="post" name="form1">

<!-- 分页开始 ------------------------------------------------------------------------------------->

<script>
function topage(firstIndex){
var form = document.form1;
form.firstIndex.value=firstIndex;
form.submit();
}
</script>
<p class="align_right" >
<input type="hidden" name="firstIndex"/>
<span>共 <s:property value="plp.totalResult"/> 条</span>
<span>共 <s:property value="plp.pageCount"/> 页</span>
<span>当前第 <s:property value="firstIndex"/> 页</span>
 <s:bean
name="org.apache.struts2.util.Counter" id="counter">
<s:param name="first" value="1" />
<s:param name="last" value="plp.pageCount" />
<s:if test="plp.pageCount<5">
<s:iterator>
<input class="mulButton" οnclick="javascript:topage('<s:property/>')" type="button" value="<s:property />"/> 
</s:iterator>
</s:if>
<s:else>
<s:iterator status="curren" id="dangqian">
<s:if
test="
firstIndex==#curren.count or
firstIndex+1==#curren.count or
firstIndex-1==#curren.count or
#curren.count==plp.pageCount or
#curren.count==1
">
<s:if test="firstIndex==#curren.count">

<input class="mulButton" οnclick="javascript:topage('<s:property/>')" type="button" value="<s:property value="#curren.count" />"/>
</s:if>
<s:if test="firstIndex!=#curren.count">
<input class="mulButton" οnclick="javascript:topage('<s:property/>')" type="button" value="<s:property value="#curren.count" />"/>
</s:if>
</s:if>
<s:if test="firstIndex-2==#curren.count and firstIndex-2!=1">
<span>…</span>
</s:if>
<s:if
test="firstIndex+2==#curren.count and firstIndex+2!=plp.pageCount">
<span>…</span>
</s:if>


</s:iterator>
</s:else>
</s:bean>
<input type="text" id="topageValue"/> <input class="mulButton" type="button" οnclick="javascript:topage($('#topageValue').val())" value="GO!">

</p><!-- 分页结束 ----------------------------------------------------------------------------------------------------------->

</form>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值