zoukankan      html  css  js  c++  java
  • ECSHOP首页成功实现订单上下滚动

    首先在library/下新建一个gundong.lbi文件代码如下

    <div style="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 -->


    这种方法还会出现问题,就是非注册用户购买时,用户名就不显示了。

  • 相关阅读:
    Javascript自动垃圾收集机制
    Javascript深入浅出(二)
    Javascript深入浅出(一)
    递归&循环&迭代&遍历&枚举,知多少
    事件流、事件处理程序和事件对象
    弹性布局学习笔记
    css3 伪元素
    css3伪类选择器nth-of-type,:nth-last-of-type,:first-of-type,:last-of-type,:only-of-type
    css3结构伪类选择器first-child,last-child,nth-child(),nth-last-child(),only-child
    css3状态伪类选择器:checked修改按钮默认样式
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2809943.html
Copyright © 2011-2022 走看看