谁能给一个类似FLASH图片轮播滚动的代码,网上的都是固定的图片和文字,我要设计一个 取自数据库的图片及链接的.(C#)谢谢了

解决方案 »

  1.   

      <td height="226">
        <div id="yingchang" style=" display:none;">
            <asp:Label ID="Label1" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label3" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label4" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label5" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label6" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label7" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label8" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label9" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label10" runat="server" Text="Label" Enabled="False"></asp:Label>
            <asp:Label ID="Label11" runat="server" Text="Label" Enabled="False"></asp:Label>
            </div>
                              <SCRIPT language=JavaScript>
                                var widths=302;  //焦点图片宽
                                var w=2;
                                var widthss=widths+w;
                                var heights=226; //焦点图片高
                                var heightss=heightss+w;
                                var heightt=20;
                                var counts=5;    //总条数
                                //img1=new Image();在这里是声明了一个图片元素的对象
                                //后面是对图像的属性进行赋值或设置,如imgs.src="xxxx.jpg"是指定图片的索引地址.
                                //这个代码一般用于head区,用于预加载图片,即加快图片显示.
                                //只有用new Images()得到的图片IE7才认,
                                //而IE6和firefox可认得imgUrl[1]="/y9q9ms7lbgbt.jpg";得到的图片
                                //   var lbl=document.all("Label1");
                                img1=new Image();img1.src=document.all("Label1").innerText;
                                url1=new Image();url1.src='###';
                                txt1=new Image();txt1.txt=document.all("Label7").innerText;
                                                
                                img2=new Image();img2.src=document.all("Label3").innerText;
                                url2=new Image();url2.src='###';
                                txt2=new Image();txt2.txt=document.all("Label8").innerText;
                                                
                                img3=new Image();img3.src=document.all("Label4").innerText;
                                url3=new Image();url3.src='###';
                                txt3=new Image();txt3.txt=document.all("Label9").innerText;
                                                
                                img4=new Image();img4.src=document.all("Label5").innerText;
                                url4=new Image();url4.src='###';
                                txt4=new Image();txt4.txt=document.all("Label10").innerText;                            img5=new Image();img5.src=document.all("Label6").innerText;
                                url5=new Image();url5.src='###';
                                txt5=new Image();txt5.txt=document.all("Label11").innerText;
                                               
                                var nn=1; //当前所显示的滚动图
                                var key=0;  //标识是否为第一次开始执行
                                var tt;  //标识作用                            function change_img()
                                {
                                if(key==0){key=1;} //如果第一次执行KEY=1,表示已经执行过一次了。
                                else if(document.all)//document.all仅IE6/7认识,firefox不会执行此段内容
                                {
                                document.getElementById("pic").filters[0].Apply(); //将滤镜应用到对像上
                                document.getElementById("pic").filters[0].Play(duration=2);  //开始转换
                                document.getElementById("pic").filters[0].Transition=23;//转换效果
                                }                            eval('document.getElementById("pic").src=img'+nn+'.src');   //替换图片
                                eval('document.getElementById("url").href=url'+nn+'.src'); //替换URL
                                eval('document.getElementById("title").value=txt'+nn+'.txt'); //替换ALT                             for (var i=1;i<=counts;i++)
                                {
                                  document.getElementById("xxjdjj"+i).className='axx';   //将下面黑条上的所有链接变为未选中状态
                                }
                                document.getElementById("xxjdjj"+nn).className='bxx';    //将当前页面的ID设置为选中状态
                                nn++;
                                if(nn>counts){nn=1;}  //如果ID大于总图片数量。则从头开始循环
                                tt=setTimeout('change_img()',4000);  //在4秒后重新执行change_img()方法.
                                }
                                function changeimg(n)//点击黑条上的链接执行的方法。
                                {
                                nn=n; //当前页面的ID等于传入的N值,
                                window.clearInterval(tt); //清除用于循环的TT
                                //重新执行change_img();但change_img()内所调用的图片ID已经在此处被修改,会从新ID处开始执行.
                                change_img();
                                }
                                //样式表
                                document.write('<style>');
                                document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;font-size:12px;}');
                                document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
                                document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
                                document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
                                document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#009900;}');
                                document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#ff9900;}');
                                document.write('</style>');
                                //内容部分
                                document.write('<div style="width:'+widthss+'px;height:'+heights+'px;overflow:hidden;text-overflow:clip;float:left;">');
                                document.write('<div><a id="url" target="_blank"><img id="pic" style="border:1px #cbcbcb solid;FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=2,transition=23)" width='+widths+' height='+heights+' /></a></div>');
                                document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=90);background: #888888;width:100%-2px;text-align:right;top:-16px;position:relative;margin:1px;height:14px;border:0px;padding-top:1px;z-index:4000;"><div>');
                                for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
                                document.write('</div></div></div>');
                                document.write('<div align=center><input id="title" type="txt" style="height:20px;background-color:#f2f6fb;border:0px solid #f2f6fb;width:'+widthss+'px;color:#ff8800;font-size:9pt;position:relative;padding-top:1;text-align:center;"></div>');
                                //document.write('</div>');
                                //开始执行滚动操作
                                change_img();                            //-->
                             </SCRIPT>
                       
    </td>
      

  2.   


    flash播放器动态绑定一样的用啊
      

  3.   


    <script type="text/javascript">
    imgUrl1="images/fj1.jpg";
    imgtext1="景点掠影"
    imgLink1=escape("1");
    imgUrl2="images/fj2.jpg";
    imgtext2="景点掠影"
    imgLink2=escape("2");
    imgUrl3="images/fj3.jpg";
    imgtext3="景点掠影"
    imgLink3=escape("3");
    imgUrl4="images/fj4.jpg";
    imgtext4="景点掠影"
    imgLink4=escape("3");
    imgUrl5="images/fj5.jpg";
    imgtext5="景点掠影"
    imgLink5=escape("4"); var focus_width=292
     var focus_height=169
     var text_height=0
     var swf_height = focus_height+text_height
     
     var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
     var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
     var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
     
     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="../Iframes/focus1.swf"><param name="quality" value="high"><param name="bgcolor" value="#33cc33">');
     document.write('<param name="menu" value="false"><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('</object>');
    </script>把数据库的数据赋值到imgUrl1,imgtext1,imgLink1...
      

  4.   

    参考
    http://topic.csdn.net/u/20070111/15/b94ae7ce-b6c9-495f-b885-9b8c68322542.html