zoukankan      html  css  js  c++  java
  • GridView内的数据循环滚动

    <div id="head1"></div>
     <div id="PriceView" style="height:186px;100%;overflow-y: hidden;">
    <div id="PriceView1">
    <asp:GridView ID="grwPriceList" runat="server"  AllowSorting="True" AutoGenerateColumns="False"
        CellPadding="4" ForeColor="#333333" Width="100%"> 
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:BoundField DataField="ProductId" Visible="False" />
            <asp:BoundField DataField="ProductName" HeaderText="品名" />
             <asp:BoundField DataField="Spec" HeaderText="规格"/>
            <asp:BoundField DataField="MaxPrice" HeaderText="最高价"/>
            <asp:BoundField DataField="MinPrice" HeaderText="最低价"/>
            <asp:BoundField DataField="AvgPrice" HeaderText="均价"/>
             <asp:BoundField DataField="PriceDate" HeaderText="时间"/>
            
            
            <asp:TemplateField HeaderText="趋势">
                <ItemTemplate>
    <a href="javascript:void(window.open('ShowChart.aspx?ProductID= <%# Eval( "ProductID" )%>','', 'toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no,height=450,width=840'));" target="_top" > <img alt="" style="border:0;" src="img/chart.png"  />               
                   </a> 

                </ItemTemplate>
            </asp:TemplateField>
            
            
        </Columns>
                    <RowStyle BorderColor="#EEEEEE" BorderStyle="Dotted" BorderWidth="1px"    />
                       <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"  />
    </asp:GridView>
        </div>

    <div id="PriceView2"></div>
    </div>
     <script>
          function scrool() {
              var t = document.getElementById("<%=grwPriceList.ClientID%>");
              var t2 = t.cloneNode(true)
              for (i = t2.rows.length - 1; i > 0; i--)
                  t2.deleteRow(i)
              t.deleteRow(0)
              head1.appendChild(t2)
              ss();
          }
          window.onload = scrool
    </script>
    <script>
        function ss() {
            var speed0 = 40
            var PriceView = document.getElementById("PriceView");
            var PriceView2 = document.getElementById("PriceView2");

            var PriceView1 = document.getElementById("PriceView1");

            PriceView2.innerHTML = PriceView1.innerHTML
            function Marquee0() {
                if (PriceView2.offsetTop - PriceView.scrollTop <= 20)
                    PriceView.scrollTop -= PriceView1.offsetHeight
                else {
                    PriceView.scrollTop++
                }
            }
            var MyMar0 = setInterval(Marquee0, speed0)
            PriceView.onmouseover = function () { clearInterval(MyMar0) }
            PriceView.onmouseout = function () { MyMar0 = setInterval(Marquee0, speed0) }
        }
    </script>

  • 相关阅读:
    tensorflow (七) k-means
    如何提升开发效率-前端技术选型篇
    Spring AOP详解
    Vue.js学习笔记-入门
    拥抱Vue,抛弃jQuery
    HTML+CSS实现审核流程步骤效果
    测试SpringMVC可能出现的线程安全问题
    CGLib动态创建对象和属性
    jconsole观察jvm中线程及GC情况
    Java NIO学习笔记-Selector
  • 原文地址:https://www.cnblogs.com/malcolm/p/2203406.html
Copyright © 2011-2022 走看看