请教用C#ASP.Net编写的首页公告滚动代码

解决方案 »

  1.   

    用javascript 或dhtml,都可以做到。
    不要直接在服务器端跑程序的
      

  2.   

    <marquee direction="up">ok</marquee>
      

  3.   

    http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/marquee.asp
      

  4.   

    <div id="newsBlock"> 
    <div id="subBlock"> <div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">&Ecirc;&yen;&Iuml;ó&frac14;&macr;&Iacute;&Aring;2004&Auml;ê&para;&Egrave;&Egrave;&laquo;&sup1;ú&Ecirc;&Ucirc;&ordm;ó·&thorn;&Icirc;&ntilde;&sup1;¤×÷&raquo;á&Ograve;é&Ocirc;&Uacute;&frac34;&copy;&Otilde;&Ugrave;&iquest;&ordf; [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050310103546.htm" >&sup1;&Oslash;&Oacute;&Uacute;&Iacute;&sup3;&Ograve;&raquo;&iquest;&ordf;&frac34;&szlig;&AElig;·&Aring;&AElig;±&pound;&Ouml;¤&frac12;&eth;&Ecirc;&Otilde;&frac34;&Yacute;&micro;&Auml;&Iacute;¨&Ouml;&ordf;</a>&nbsp;[2005-3-10]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">&Ecirc;&yen;&Iuml;ó&frac14;&macr;&Iacute;&Aring;2004&Auml;ê&para;&Egrave;&Egrave;&laquo;&sup1;ú&Ecirc;&Ucirc;&ordm;ó·&thorn;&Icirc;&ntilde;&sup1;¤×÷&raquo;á&Ograve;é&Ocirc;&Uacute;&frac34;&copy;&Otilde;&Ugrave;&iquest;&ordf; [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050309144612.htm" >&Ecirc;&yen;&Ecirc;&Agrave;&Auml;ê&Acirc;&Ouml;2005&Auml;ê&acute;&ordm;&frac14;&frac34;&Egrave;&laquo;&sup1;ú&frac14;&Oacute;&Atilde;&Euml;&Eacute;&Igrave;&Ccedil;&cent;&Igrave;&cedil;&raquo;á&Ocirc;&Uacute;&para;&laquo;&Yacute;&cedil;&frac34;&Ugrave;&ETH;&ETH;</a>&nbsp;[2005-3-9]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">&Ecirc;&yen;&Iuml;ó&frac14;&macr;&Iacute;&Aring;2004&Auml;ê&para;&Egrave;&Egrave;&laquo;&sup1;ú&Ecirc;&Ucirc;&ordm;ó·&thorn;&Icirc;&ntilde;&sup1;¤×÷&raquo;á&Ograve;é&Ocirc;&Uacute;&frac34;&copy;&Otilde;&Ugrave;&iquest;&ordf; [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050308154413.htm" >&Icirc;&ordf;&Egrave;&laquo;&Atilde;&aelig;&Ecirc;&micro;&Ecirc;&copy;&AElig;·&Aring;&AElig;&Otilde;&frac12;&Acirc;&Ocirc;&acute;&icirc;&Ccedil;&Aring;&Ouml;ú&Iacute;&thorn;</a>&nbsp;[2005-3-8]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">&Ecirc;&yen;&Iuml;ó&frac14;&macr;&Iacute;&Aring;2004&Auml;ê&para;&Egrave;&Egrave;&laquo;&sup1;ú&Ecirc;&Ucirc;&ordm;ó·&thorn;&Icirc;&ntilde;&sup1;¤×÷&raquo;á&Ograve;é&Ocirc;&Uacute;&frac34;&copy;&Otilde;&Ugrave;&iquest;&ordf; [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050307151814.htm" >&iexcl;°3F&ordm;&Atilde;&micro;&Oslash;°&aring;&pound;&not;E0&frac12;&iexcl;&iquest;&micro;&Iuml;&Egrave;·&aelig;&ETH;&ETH;&iexcl;±&Atilde;&frac12;&Igrave;&aring;&frac14;&ucirc;&Atilde;&aelig;&raquo;á&frac14;&Ccedil;&Otilde;&szlig;&raquo;&Oslash;&acute;&eth;</a>&nbsp;[2005-3-7]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">&Ecirc;&yen;&Iuml;ó&frac14;&macr;&Iacute;&Aring;2004&Auml;ê&para;&Egrave;&Egrave;&laquo;&sup1;ú&Ecirc;&Ucirc;&ordm;ó·&thorn;&Icirc;&ntilde;&sup1;¤×÷&raquo;á&Ograve;é&Ocirc;&Uacute;&frac34;&copy;&Otilde;&Ugrave;&iquest;&ordf; [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050307151650.htm" >&Ecirc;&yen;&Iuml;ó&iexcl;°3F&ordm;&Atilde;&micro;&Oslash;°&aring;&iexcl;±EO&frac12;&iexcl;&iquest;&micro;&Iuml;&Egrave;·&aelig;&ETH;&ETH;&para;&macr;&frac14;&Ccedil;&Otilde;&szlig;&frac14;&ucirc;&Atilde;&aelig;&raquo;á</a>&nbsp;[2005-3-7]
    </div>
    </div>
    </div>
    </div>
    <script>
    var block = document.all["newsBlock"]
    block.insertAdjacentHTML("beforeEnd" , block.children[0].outerHTML)
    block.runtimeStyle.overflow = "hidden" setInterval(function()
    {
    block.scrollTop++
    block.runtimeStyle.height = block.children[0].offsetHeight
    if ((block.scrollTop + block.children[0].offsetHeight) == block.scrollHeight) block.scrollTop = 1
    },20)
    </script>
      

  5.   

    <div id="newsBlock"> 
    <div id="subBlock"> <div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">圣象集团2004年度全国售后服务工作会议在京召开 [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050310103546.htm" >关于统一开具品牌保证金收据的通知</a>&nbsp;[2005-3-10]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">圣象集团2004年度全国售后服务工作会议在京召开 [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050309144612.htm" >圣世年轮2005年春季全国加盟商洽谈会在东莞举行</a>&nbsp;[2005-3-9]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">圣象集团2004年度全国售后服务工作会议在京召开 [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050308154413.htm" >为全面实施品牌战略搭桥助威</a>&nbsp;[2005-3-8]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">圣象集团2004年度全国售后服务工作会议在京召开 [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050307151814.htm" >“3F好地板,E0健康先锋行”媒体见面会记者回答</a>&nbsp;[2005-3-7]
    </div><div style="padding:3px; padding-left: 10px; border-bottom: 1px solid #239CED;"><img src="/images/icon3.jpg" width="11" height="11"> 
    <!--<a href="#">圣象集团2004年度全国售后服务工作会议在京召开 [2004-12-1 8:50:57]</a>-->
    <a href="/news/newshtml/hyrd/20050307151650.htm" >圣象“3F好地板”EO健康先锋行动记者见面会</a>&nbsp;[2005-3-7]
    </div>
    </div>
    </div>
    </div>
    <script>
    var block = document.all["newsBlock"]
    block.insertAdjacentHTML("beforeEnd" , block.children[0].outerHTML)
    block.runtimeStyle.overflow = "hidden" setInterval(function()
    {
    block.scrollTop++
    block.runtimeStyle.height = block.children[0].offsetHeight
    if ((block.scrollTop + block.children[0].offsetHeight) == block.scrollHeight) block.scrollTop = 1
    },20)
    </script>