捕風之巢

          統計

          留言簿(3)

          java友情鏈接

          閱讀排行榜

          評論排行榜

          實現圖片和flash的混合切換

          <html>
          <head>

          <script language='javascript'>
          function showitem(itemname,itemsrc,itemtype)
          {
          ?this.itemname=itemname;
          ?this.itemsrc=itemsrc;
          ?this.itemtype=itemtype;
          ?
          ?this.play=showplay;
          }
          function showplay()
          {
          ?if(this.itemtype=='img'){
          ??
          ?}else{
          ?
          ?}
          }
          function itemlist(){
          this.item1=new showitem("item1","1.gif","img");
          this.item2=new showitem("item2","pixviewer.swf","fla");
          this.item3=new showitem("item3","2.gif","img");
          this.item4=new showitem("item4","1.gif","img");
          this.item5=new showitem("item5","2.gif","img");
          this.size=5;
          }

          var mylist=new itemlist();
          mysize=mylist.size;
          count=1;


          function change_item()
          {
          var myitem = mylist['item'+count];
          var preitem ;
          if(count>1){
          ?preitem = mylist['item'+(count-1)];
          }else{
          ?preitem = mylist['item'+count];
          }

          if(myitem.itemtype=='img'){
          ?document.all('picdiv').style.backgroundImage='url('+preitem.itemsrc+')';
          ?
          ?document.pic.src=myitem.itemsrc;
          ?document.all('picdiv').style.display='';
          ?document.all('fladiv').style.display='none';

          ?pic.filters.revealTrans.Transition=6;
          ?pic.filters.item(0).apply()
          ?pic.style.visibility='visible'
          ?pic.filters.item(0).play()
          ?setTimeout("pic.style.visibility='hidden'",2000);
          }else{?
          ?document.all('fladiv').style.backgroundImage='url('+preitem.itemsrc+')';
          ?
          ?document.all('picdiv').style.display='none';
          ?document.all('fladiv').style.display='';
          ?
          }
          count++;
          if(count>mysize) count=1
          tt=setTimeout('change_item()',2000)
          }

          ?

          </script>

          </head>
          <body onload="change_item();">
          <table width="120" height="90"><tr><td>
          <div id="picdiv" name="picdiv" width="120" height="90">
          ?<img src='1.gif' id="pic" name="pic" width="120" height="90"? style='visibility:hidden;filter:revealtrans(duration=2.0,transition=0)'>
          ?
          </div>
          <div id="fladiv" name="fladiv" style="display:''" width="120" height="90">
          <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='/swflash.cab#version=6,0,0,0' width='120' height='90'>

          ??????? <param name=movie value='pixviewer.swf'>

          ??????? <param name=quality value=high>

          ??????? <embed src='pixviewer.swf' quality=high pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash width='120' height='90'>

          ??????? </embed>

          </object>
          </div>
          </td>
          </tr>
          </table>

          </body>
          </html>

          posted on 2006-10-31 15:10 捕風 閱讀(392) 評論(0)  編輯  收藏 所屬分類: web 頁面開發

          主站蜘蛛池模板: 凯里市| 来安县| 绥宁县| 辉南县| 墨玉县| 任丘市| 时尚| 肇源县| 安溪县| 鄂托克旗| 海晏县| 松潘县| 伊春市| 兴文县| 津南区| 潮州市| 石台县| 改则县| 南汇区| 叙永县| 北票市| 海阳市| 武威市| 乐亭县| 涡阳县| 万安县| 甘孜县| 名山县| 东莞市| 日照市| 德钦县| 五指山市| 大英县| 湘潭县| 六安市| 天气| 白玉县| 上杭县| 阿勒泰市| 酒泉市| 平塘县|