zoukankan      html  css  js  c++  java
  • 12345图片滚动(动态读取后台数据)

     <div   class="boder">
                <script type="text/javascript">
                 var focus_width=450;
                 var focus_height=275;
                 var text_height=24;
                 var swf_height = focus_height+text_height;
                 var pics='<%=imgurl %>';
                 var texts='<%=imgtitle %>';
                 var links='<%=links %>';
                 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
                 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#f7fbff">');
                 document.write('<param name="menu" value="false"><param name="Loop" value="-1"><param name="wmode" value="opaque">');
                 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
                 document.write('<embed src="focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#9ccfce" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
                 document.write('</object>');
                </script>
            </div>

    protected void Page_Load(object sender, EventArgs e)
        {
            BindImgData();
        }

        //绑定图片新闻
        public void BindImgData()
        {
            DataTable dt = new DataTable();
            dt = BLL.sen.GetImg(10, 6);//注意纳税服务图片ID
            string img = "";
            string text = "";
            string link = "";
            if (dt == null)
            {
                this.imgurl = "";
                this.links = "";
                this.imgtitle = "";
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    img += "|Files/images/" + dt.Rows[i]["url"].ToString();
                    text += "|" + dt.Rows[i]["title"].ToString();
                    link += "|" + "shownashuifuwuflashnews.aspx?id=" + dt.Rows[i]["id"];
                }
                this.imgurl = img.Substring(1, img.Length - 1);
                this.imgtitle = text.Substring(1, text.Length - 1);
                this.links = link.Substring(1, link.Length - 1);
            }
        }

  • 相关阅读:
    js原型、原型链、继承的理解
    实用的Object操作方法
    数组操作方法汇总
    ES6数组去重、字符串去重
    ES6新增数据结构:Set和Map
    canvas图片、文字在移动端显示模糊问题
    Tabindex
    javascript 单元测试初入门
    ng-file-upload(在单文件选择,并且通过点击“上传”按钮上传文件的情况下,如何在真正选择文件之前保留上一文件信息?)
    如何优化表单验证
  • 原文地址:https://www.cnblogs.com/jcomet/p/1693630.html
Copyright © 2011-2022 走看看