请高手帮帮忙, 我现在要在网页里面嵌入PPT, WORD 文档,我想控制它们的播放进程, 我如何才能用JS获取它的当前页码呢! 或是,有没有其他的办法!请各位高手帮帮忙拉  ! 一定给分的!

解决方案 »

  1.   

    在网页中嵌入ppt,可以手动控制ppt的播放,也可以设定每张ppt的播放时间让ppt自动播放。首先是把ppt另存为图片格式.jpg 或者.gif。
    <html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>网贝博客图片自动播放器</title>
    <script language="JavaScript">
    function (objectId) {  
         if(document.getElementById && document.getElementById(objectId)) {  
        // W3C DOM  
           return document.getElementById(objectId);  
         }   
         else if (document.all && document.all(objectId)) {  
        // MSIE 4 DOM  
           return document.all(objectId);  
         }   
         else if (document.layers && document.layers[objectId]) {  
        // NN 4 DOM.. note: this won't find nested layers  
           return document.layers[objectId];  
         }   
         else {  
           return false;  
        }  

    var goid=0;
    var t=0;  function ImgArray(len)
      {
       this.length=len;
       }
      ImgName=new ImgArray(3);
      ImgName[0]="1.jpg";
    ImgName[1]="2.jpg";
    ImgName[2]="3.jpg";
    ImgName[3]="4.jpg";
    var d=document; 
    if (d.images){ 
      if(!d.dxypp) var dxypp=new Array(); 
      var j=d.dxypp.length; 
      for(var ii=0;ii<imglen;ii++){ 
          d.dxypp[j].src=ImgName[ii]; 
        } 

      function playImg()
      {
        t_end=document.player.intsec.value;
     if (t==3)
        {
         t=0;
        }
        else
        {t++;}
     if (t==3)
        {
         t_end=10000;
        }
     if (goid==0){
       img.style.filter="blendTrans(Duration=1)";
       img.filters[0].apply();
       img.src="ImgName[t]";
       tIndex=t;
       img.filters[0].play();
       mytimeout=setTimeout("playImg()",t_end);
     }
       }
       
       function go(id){
        if (id==1){
         goid=0
         playImg();
         }
        else if(id==2){
         goid=1;
         }
        else if(id==3){ 
         goid=1;
         t=t+1;
         if (t<=3) img.src="ImgName[t+1]";   
     }
     else if(id==4){
      goid=1;
      t=t-1;
       if (t>0) img.src="ImgName[t]";
     }
     else if(id==5){
      goid=1;
      t=0;
      playImg();
     }
     else{
      goid=0;
      t=0;
      playImg();
      }
      
        }
    </script><style>
    body img{border:3px ridge gold; }
    td,body {
     color:#4b4b4b;
     font-size:12px;
     font-family:arial,sans-serif; 
     }
    .photobox { 
     border-top: 2px dotted #C6CFBD;
     border-left: 2px dotted #C6CFBD;
     border-right: 2px dotted #C6CFBD;
     border-bottom: 2px dotted #C6CFBD;
    }</style>
    </head><body bgcolor="#FFFFFF"  onload="playImg()"><div align="center">
      <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="458">
        <tr>
          <td width="458" align=center>
          <p align="center"><b><font color="#000000">网贝博客图片自动播放器</font></b><BR/><BR/></td>
        </tr>
       <form name="player" method="post" action="">
       <tr>
       <td>
        播放频率:
         <select name="intsec">
          <option value=1000>1秒</option>
          <option value=3000 Selected>3秒</option>
          <option value=5000>5秒</option>
          <option value=8000>8秒</option>
          <option value=10000>10秒</option>
         </select>
       <input type="button" value="开始" onclick="javascipt:go(1)">
         <input type="button" value="停止" onclick="javascipt:go(2)">
         <input type="button" value="上一张" onclick="javascipt:go(3)">
         <input type="button" value="下一张" onclick="javascipt:go(4)">
         <input type="button" value="关闭" onclick="javascipt:window.close();">
         <BR/>
         <BR/>
       </td>
       </tr>
     </form>
       <tr>
          <td width="458" class="photobox" align=center valign=middle>
           <BR/>
          <center><img src="image/1.png" name="img" onload="if(this.width>=400)this.width=400;" onclick="window.open(img.src);" style="cursor:hand"></center>
           <BR/>
        </tr>
      </table>
      </center>
    </div>
    <p>&nbsp;</p></body>
    </html>