繼續關注我的C語言學習博客

          林臨的地盤

          java學習博客
          posts - 44, comments - 28, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          頁面飄窗設計

          Posted on 2007-02-08 18:01 lubaolin 閱讀(5001) 評論(2)  編輯  收藏
          <SCRIPT>
          var imagepath="10cfeba177b.jpg"
          var imagewidth=200 //這兩行寫圖片的大小
          var imageheight=300
          var speed=2;
          var imageclick="index0.htm" //這里寫點擊圖片連接到的地址
          var hideafter=0
          var isie=0;
          if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
          isie=1;
          }
          else {
          isie=0;
          }
          if(isie){
          var preloadit=new Image()
          preloadit.src=imagepath
          }
          function pop() {
          if(isie) {
          x=x+dx;y=y+dy;
          oPopup.show(x, y, imagewidth, imageheight);
          if(x+imagewidth+5>screen.width) dx=-dx;
          if(y+imageheight+5>screen.height) dy=-dy;
          if(x<0) dx=-dx;
          if(y<0) dy=-dy;
          startani=setTimeout("pop();",50);
          }
          }
          function dismisspopup(){
          clearTimeout(startani)
          oPopup.hide()
          }
          function dowhat(){
          if (imageclick=="dismiss")
          dismisspopup()
          else
          window.open(imageclick);
          }
          if(isie) {
          var x=0,y=0,dx=speed,dy=speed;
          var oPopup = window.createPopup();
          var oPopupBody = oPopup.document.body;
          oPopupBody.style.cursor="hand"
          oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">';
          oPopup.document.body.onmouseover=new Function("clearTimeout(startani)")
          oPopup.document.body.onmouseout=pop
          oPopup.document.body.onclick=dowhat
          pop();
          if (hideafter>0)
          setTimeout("dismisspopup()",hideafter*1000)
          }
          </SCRIPT>

          評論

          # re: 頁面飄窗設計  回復  更多評論   

          2008-05-29 15:56 by 嘮叨老道
          這段代碼 飄窗 的范圍是整個電腦屏幕,如何裝到網頁里?

          # re: 頁面飄窗設計  回復  更多評論   

          2010-08-09 14:07 by 嘮叨嘮叨
          最小化后飄窗如何隱藏啊

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          繼續關注我的C語言學習博客
          主站蜘蛛池模板: 荣成市| 都匀市| 秭归县| 黄山市| 姜堰市| 咸阳市| 烟台市| 澄江县| 安泽县| 资溪县| 旺苍县| 称多县| 翼城县| 耒阳市| 从江县| 福海县| 巴林右旗| 惠水县| 若尔盖县| 梁河县| 弋阳县| 淮北市| 镇宁| 积石山| 汉源县| 宿州市| 定西市| 田林县| 九江县| 且末县| 龙门县| 阳原县| 滨州市| 黔东| 长岭县| 江安县| 乌鲁木齐县| 上思县| 河东区| 朝阳市| 建始县|