详情页

ECSHOP首页成功实现订单上下滚动

时间:2024年02月04日

编辑:佚名

首先在library/下新建一个gundong.lbi文件,代码如下
复制代码
<div style="width:1020px; margin-bottom:5px;height:29px;overflow:hidden; background:url(/themes/Fuu%20Lace/images/new_order.gif)">
    <div id="noticev2" style="white-space:nowrap; padding-left:150px; line-height:29px;">
    {foreach from=$order_list item=order}
      <span style="padding-left:100px">{$order.order_sn}</span><span style="padding-left:100px">{$order.user_name}</span>  <span style="padding-left:100px">
{$order.region_name}</span> <span style="padding-left:100px"> ${$order.order_amount}</span> <span id="order_status" style="padding-left:100px">{if $order.order_status eq 5}
Deliveried{else}{$order.order_status}{/if}</span><br>
    {/foreach}
    </div>
</div>
<script>
var tID;
var tn;
var nStopTime=3000
var nSpeed=50
var isMove=true;
var nHeight=29;
var nS=0
var nNewsCount=0
function moveT(n)
{
    clearTimeout(tID)
    var noticev2= document.getElementById("noticev2")
    if(n)
    {
        noticev2.style.lineHeight=nHeight+"px";
        var theText=noticev2.innerHTML.toLowerCase();   
        nNewsCount=theText.split("<br>").length    
        noticev2.innerHTML+="<br>"+noticev2.innerHTML;
        tn=nHeight;
    }
    nS=nSpeed;
    if(isMove)
    {
        noticev2.style.marginTop=tn+"px";
        if((tn-2)%nHeight==0)
        {
            nS=nSpeed+nStopTime;
        }
        tn--;
        if(Math.abs(tn)==(nNewsCount*nHeight*2-nHeight))
        tn=(nNewsCount-1)*nHeight*-1;
    }
    tID=setTimeout("moveT()",nS);
}
moveT(1);
</script>
复制代码
2. 然后在首页想插入的地方插入以下代码
<!-- #BeginLibraryItem "/library/gundong.lbi" --><!-- #EndLibraryItem -->
这种方法还会出现问题,就是非注册用户购买时,用户名就不显示了。
相关文章
猜你需要