Java教程

原生分页 带前后省略号判断

本文主要是介绍原生分页 带前后省略号判断,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
{if ($page_list.page['sum']>1) AND ($page_list.page['sum']>=$page_list.page['page'])}
<div class="turn_pagination">
    {volist name="page_list" id="page_number" }
    <div class="turn_ul">
        {gt name="$page_number['page']" value="1"}
        <div class="turn_previous">上一页</div>
        {/gt}
        {if $page_number['sum']<10 AND $page_number['sum']>1}
        <div {eq name="$page_number['page']" value="1" } class="active" {else
        /}class="turn_li"{/eq}>1
    </div>
    {if $page_number['sum']>2 }
    <div {eq name="$page_number['page']" value="2" } class="active" {else
    /}class="turn_li"{/eq}>2
</div>
{/if}
{if $page_number['sum']>3}
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
{/if}
{if $page_number['sum']>4}
<div {eq name="$page_number['page']" value="4" } class="active" {else/}class="turn_li"{/eq}>4</div>
{/if}
{if $page_number['sum']>5}
<div {eq name="$page_number['page']" value="5" } class="active" {else/}class="turn_li"{/eq}>5</div>
{/if}
{if $page_number['sum']>6}
<div {eq name="$page_number['page']" value="6" } class="active" {else/}class="turn_li"{/eq}>6</div>
{/if}
{if $page_number['sum']>7}
<div {eq name="$page_number['page']" value="7" } class="active" {else/}class="turn_li"{/eq}>7</div>
{/if}
{if $page_number['sum']>8}
<div {eq name="$page_number['page']" value="8" } class="active" {else/}class="turn_li"{/eq}>8</div>
{/if}
{/if}

{if  $page_number['sum']==10 }
<div {eq name="$page_number['page']" value="1" } class="active" {else/}class="turn_li"{/eq}>1</div>
{if  $page_number['page']>3 }
<div class="turn_point">...</div>
{else/}
<div {eq name="$page_number['page']" value="2" } class="active" {else/}class="turn_li"{/eq}>2</div>
{/if}
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
<div {eq name="$page_number['page']" value="4" } class="active" {else/}class="turn_li"{/eq}>4</div>
<div {eq name="$page_number['page']" value="5" } class="active" {else/}class="turn_li"{/eq}>5</div>
<div {eq name="$page_number['page']" value="6" } class="active" {else/}class="turn_li"{/eq}>6</div>
<div {eq name="$page_number['page']" value="7" } class="active" {else/}class="turn_li"{/eq}>7</div>
<div {eq name="$page_number['page']" value="8" } class="active" {else/}class="turn_li"{/eq}>8</div>
{if  $page_number['page']>3 }
<div {eq name="$page_number['page']" value="9" } class="active" {else/}class="turn_li"{/eq}>9</div>
{else/}
<div class="turn_point">...</div>
{/if}
{/if}


{if  $page_number['sum']>10 AND $page_number['page']<4}
<div {eq name="$page_number['page']" value="1" } class="active" {else/}class="turn_li"{/eq}>1</div>
<div {eq name="$page_number['page']" value="2" } class="active" {else/}class="turn_li"{/eq}>2</div>
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
<div class="turn_li">4</div>
<div class="turn_li">5</div>
<div class="turn_li">6</div>
<div class="turn_li">7</div>
<div class="turn_li">8</div>
<div class="turn_point">...</div>
{elseif $page_number['sum']>10 AND $page_number['sum']-$page_number['page']<=7 /}


<div class="turn_li">1</div>
<div class="turn_point">...</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-7" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-7}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-6" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-6}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-5" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-5}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-4" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-4}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-3" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-3}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-2" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-2}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-1" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-1}</div>


{elseif $page_number['sum']>10 AND $page_number['sum']-$page_number['page']>7 /}
<div class="turn_li">1</div>
<div class="turn_point">...</div>
<div class="turn_li">{$page_number['page']-1}</div>
<div class="active">{$page_number['page']}</div>
<div class="turn_li">{$page_number['page']+1}</div>
<div class="turn_li">{$page_number['page']+2}</div>
<div class="turn_li">{$page_number['page']+3}</div>
<div class="turn_li">{$page_number['page']+4}</div>
<div class="turn_li">{$page_number['page']+5}</div>
<div class="turn_point">...</div>
{/if}


{if ( $page_number['sum']>1) AND ( $page_number['sum']==$page_number['page'])}
<div class="active">{$page_number['sum']}</div>
{else/}
<div class="turn_li">{$page_number['sum']}</div>
{/if}


{gt  name="page_number['sum']"  value="$page_number['page']"}
<div class="turn_next">下一页</div>
{/gt}
<div class="turn_text">共{$page_number['sum']}页</div>
<div class="turn_text">到第</div>
<div class="turn_input">
    <input type="text"/>
</div>
<div class="turn_text">页</div>
<div class="turn_ensure">确定</div>
</div>
{if ($page_list.page['sum']>1) AND ($page_list.page['sum']>=$page_list.page['page'])}
<div class="turn_pagination">
    {volist name="page_list" id="page_number" }
    <div class="turn_ul">
        {gt name="$page_number['page']" value="1"}
        <div class="turn_previous">上一页</div>
        {/gt}
        {if $page_number['sum']<10 AND $page_number['sum']>1}
        <div {eq name="$page_number['page']" value="1" } class="active" {else
        /}class="turn_li"{/eq}>1
    </div>
    {if $page_number['sum']>2 }
    <div {eq name="$page_number['page']" value="2" } class="active" {else
    /}class="turn_li"{/eq}>2
</div>
{/if}
{if $page_number['sum']>3}
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
{/if}
{if $page_number['sum']>4}
<div {eq name="$page_number['page']" value="4" } class="active" {else/}class="turn_li"{/eq}>4</div>
{/if}
{if $page_number['sum']>5}
<div {eq name="$page_number['page']" value="5" } class="active" {else/}class="turn_li"{/eq}>5</div>
{/if}
{if $page_number['sum']>6}
<div {eq name="$page_number['page']" value="6" } class="active" {else/}class="turn_li"{/eq}>6</div>
{/if}
{if $page_number['sum']>7}
<div {eq name="$page_number['page']" value="7" } class="active" {else/}class="turn_li"{/eq}>7</div>
{/if}
{if $page_number['sum']>8}
<div {eq name="$page_number['page']" value="8" } class="active" {else/}class="turn_li"{/eq}>8</div>
{/if}
{/if}

{if  $page_number['sum']==10 }
<div {eq name="$page_number['page']" value="1" } class="active" {else/}class="turn_li"{/eq}>1</div>
{if  $page_number['page']>3 }
<div class="turn_point">...</div>
{else/}
<div {eq name="$page_number['page']" value="2" } class="active" {else/}class="turn_li"{/eq}>2</div>
{/if}
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
<div {eq name="$page_number['page']" value="4" } class="active" {else/}class="turn_li"{/eq}>4</div>
<div {eq name="$page_number['page']" value="5" } class="active" {else/}class="turn_li"{/eq}>5</div>
<div {eq name="$page_number['page']" value="6" } class="active" {else/}class="turn_li"{/eq}>6</div>
<div {eq name="$page_number['page']" value="7" } class="active" {else/}class="turn_li"{/eq}>7</div>
<div {eq name="$page_number['page']" value="8" } class="active" {else/}class="turn_li"{/eq}>8</div>
{if  $page_number['page']>3 }
<div {eq name="$page_number['page']" value="9" } class="active" {else/}class="turn_li"{/eq}>9</div>
{else/}
<div class="turn_point">...</div>
{/if}
{/if}


{if  $page_number['sum']>10 AND $page_number['page']<4}
<div {eq name="$page_number['page']" value="1" } class="active" {else/}class="turn_li"{/eq}>1</div>
<div {eq name="$page_number['page']" value="2" } class="active" {else/}class="turn_li"{/eq}>2</div>
<div {eq name="$page_number['page']" value="3" } class="active" {else/}class="turn_li"{/eq}>3</div>
<div class="turn_li">4</div>
<div class="turn_li">5</div>
<div class="turn_li">6</div>
<div class="turn_li">7</div>
<div class="turn_li">8</div>
<div class="turn_point">...</div>
{elseif $page_number['sum']>10 AND $page_number['sum']-$page_number['page']<=7 /}


<div class="turn_li">1</div>
<div class="turn_point">...</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-7" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-7}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-6" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-6}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-5" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-5}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-4" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-4}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-3" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-3}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-2" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-2}</div>
<div {eq name="$page_number['page']" value="$page_number['sum']-1" } class="active"
     {else/}class="turn_li"{/eq}>{$page_number['sum']-1}</div>


{elseif $page_number['sum']>10 AND $page_number['sum']-$page_number['page']>7 /}
<div class="turn_li">1</div>
<div class="turn_point">...</div>
<div class="turn_li">{$page_number['page']-1}</div>
<div class="active">{$page_number['page']}</div>
<div class="turn_li">{$page_number['page']+1}</div>
<div class="turn_li">{$page_number['page']+2}</div>
<div class="turn_li">{$page_number['page']+3}</div>
<div class="turn_li">{$page_number['page']+4}</div>
<div class="turn_li">{$page_number['page']+5}</div>
<div class="turn_point">...</div>
{/if}


{if ( $page_number['sum']>1) AND ( $page_number['sum']==$page_number['page'])}
<div class="active">{$page_number['sum']}</div>
{else/}
<div class="turn_li">{$page_number['sum']}</div>
{/if}


{gt  name="page_number['sum']"  value="$page_number['page']"}
<div class="turn_next">下一页</div>
{/gt}
<div class="turn_text">共{$page_number['sum']}页</div>
<div class="turn_text">到第</div>
<div class="turn_input">
    <input type="text"/>
</div>
<div class="turn_text">页</div>
<div class="turn_ensure">确定</div>
</div>
{/volist}
</div>
{/if}

 

{/volist}
</div>
{/if}
这篇关于原生分页 带前后省略号判断的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!