织梦中js利用document.write输出图片轮播代码:

织梦中js利用document.write输出图片轮播代码:
 <div style="WIDTH: 950px; HEIGHT: 115px; COLOR: #ffffff; OVERFLOW: hidden" id="demo51">
                    <table>
                      <tbody><tr>
                        <td id="demo31">
                          <table align="center" border="0" cellpadding="0" cellspacing="5" width="100%">
                            <tbody><tr valign="top">
                            <script type="text/javascript">
                             pic = new Array();
                            url = new Array();
                            title = new Array();
                            {dede:arclist typeid='133'}
                           pic[[field:global.autoindex/]]="[field:litpic/]";
                           url[[field:global.autoindex/]]="[field:arcurl/]";
                           title[[field:global.autoindex/]]="[field:title/]";
                             {/dede:arclist}
                       var i=1
                       for (i=1;i<=pic.length;i++)
                      {
                     document.write("<td align=center><a title="+title[i]+" href="+url[i]+" target='_blank'><img class='pic' src="+pic[i]+" border=0 height=105 width=150></a></td>" );
                     }
                           </script>
                           
                            </tr>
                          </tbody></table>                        </td>
                        <td id="demo41" width="1">
                          <table align="center" border="0" cellpadding="0" cellspacing="5" width="100%">
                            <tbody><tr valign="top">
                            <script type="text/javascript">
                             pic = new Array();
                            url = new Array();
                            title = new Array();
                            {dede:arclist typeid='133'}
                           pic[[field:global.autoindex/]]="[field:litpic/]";
                           url[[field:global.autoindex/]]="[field:arcurl/]";
                           title[[field:global.autoindex/]]="[field:title/]";
                             {/dede:arclist}
                       var i=1
                       for (i=1;i<=pic.length;i++)
                      {
                    document.write("<td align=center><a title="+title[i]+" href="+url[i]+" target='_blank'><img class='pic' src="+pic[i]+" border=0 height=105 width=150></a></td>" );
             
                     }
                           </script>                  
          
                            </tr>
                          </tbody></table>                        </td>
                      </tr>
                    </tbody></table>
</div>
<script>
var speed2=30;
demo4=document.getElementByIdx_x("demo41");
demo3=document.getElementByIdx_x("demo31");
demo5=document.getElementByIdx_x("demo51");
demo4.innerHTML=demo3.innerHTML;
function Marquee2(){
if(demo4.offsetWidth-demo5.scrollLeft<=0)
demo5.scrollLeft-=demo3.offsetWidth;
else{
demo5.scrollLeft++;
}
}
var MyMar2=setInterval(Marquee2,speed2);
demo51.οnmοuseοver=function() {clearInterval(MyMar2)}
demo51.οnmοuseοut=function() {MyMar2=setInterval(Marquee2,speed2)}
                                                        </script>

转载于:https://my.oschina.net/u/130961/blog/27738

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值