織夢中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.onmouseover=function() {clearInterval(MyMar2)} demo51.onmouseout=function() {MyMar2=setInterval(Marquee2,speed2)} </script>