常言笑的家

          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)

          隨筆分類

          隨筆檔案

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 安泽县| 宾川县| 大化| 北京市| 淳化县| 庆安县| 自贡市| 长丰县| 文登市| 若尔盖县| 玉门市| 房山区| 湘乡市| 安乡县| 即墨市| 叙永县| 沙洋县| 宿迁市| 杭锦旗| 赞皇县| 卓尼县| 扶风县| 兴山县| 蛟河市| 新晃| 泸西县| 合肥市| 万山特区| 万年县| 武功县| 桦甸市| 双牌县| 呼图壁县| 博兴县| SHOW| 葫芦岛市| 商河县| 蓬莱市| 紫金县| 昭平县| 海口市|