常言笑的家

          Spring, Hibernate, Struts, Ajax, RoR

          JavaScript小技巧

          1、彈出窗口總是在最上面

          [1] <body ="this.focus();">

          [2]模態窗口showModalDialog(url); 不過模式窗口中對老頁面無法回寫,打開的子窗口不能得到openner,因此子窗口無法訪問父窗口數據. 如果要傳遞數據的話, 只能在Dialog窗口中用return,然后父窗口通過var some = showModalDialog(...)得到值.

          [3]非模態窗口window.showModelessDialog

          [4]open來打開新窗口


          2、輸入框屏蔽輸入法輸入

          [1]style="ime-mode:disabled"  <input>中加入
          [2]onpaste="return false" 不能粘貼 <body>中
          [3]oncopy="return false"  不能復制 <body>中
           
          3、各種尺寸

           1 <  LANGUAGE ="Java" >
           2
           3 var s = "網頁可見區域寬:"+ document .body.clientWidth; 
           4 s += "\r\n網頁可見區域高:"+ document .body.clientHeight; 
           5 s += "\r\n網頁可見區域高:"+ document .body.offsetWeight +" (包括邊線的寬)"; 
           6 s += "\r\n網頁可見區域高:"+ document .body.offsetHeight +" (包括邊線的寬)"; 
           7 s += "\r\n網頁正文全文寬:"+ document .body.scrollWidth; 
           8 s += "\r\n網頁正文全文高:"+ document .body.scrollHeight; 
           9 s += "\r\n網頁被卷去的高:"+ document .body.scrollTop; 
          10 s += "\r\n網頁被卷去的左:"+ document .body.scrollLeft; 
          11 s += "\r\n網頁正文部分上:"+ window .screenTop; 
          12 s += "\r\n網頁正文部分左:"+ window .screenLeft; 
          13 s += "\r\n屏幕分辨率的高:"+ window .screen.height; 
          14 s += "\r\n屏幕分辨率的寬:"+ window .screen.width; 
          15 s += "\r\n屏幕可用工作區高度:"+ window .screen.availHeight; 
          16 s += "\r\n屏幕可用工作區寬度:"+ window .screen.availWidth; 
          17 alert(s); 
          18
          19 </>
          20

          posted on 2006-12-16 22:54 常言笑 閱讀(314) 評論(0)  編輯  收藏 所屬分類: JAVASCRIPT/AJAX

          My Links

          Blog Stats

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 五家渠市| 柳江县| 龙海市| 马山县| 盐山县| 从江县| 卢龙县| 铁岭县| 合肥市| 金乡县| 珠海市| 龙山县| 东莞市| 定南县| 潜江市| 濮阳市| 屏东县| 本溪| 石渠县| 瑞昌市| 辽源市| 高台县| 海南省| 沅江市| 木里| 铅山县| 威信县| 钦州市| 敦煌市| 承德县| 浏阳市| 芦山县| 云林县| 海宁市| 绥阳县| 拉孜县| 达日县| 丰台区| 荃湾区| 石柱| 吴桥县|