隨筆 - 2  文章 - 1  trackbacks - 0
          <2008年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆分類(1)

          隨筆檔案(4)

          link

          搜索

          •  

          積分與排名

          • 積分 - 3320
          • 排名 - 3482

          最新評論

          閱讀排行榜

          評論排行榜

          26.如何設定打開頁面的大小
          <body onload="top.resizeTo(300,200);">
          打開頁面的位置
          <body onload="top.moveBy(300,200);">


          27.在頁面中如何加入不是滿鋪的背景圖片,拉動頁面時背景圖不動
          <STYLE>
          body
          {background
          -image:url(/logo.gif); background-repeat:no-repeat;
          background
          -position:center;background-attachment: fixed}
          </STYLE>


          28. 檢查一段字符串是否全由數(shù)字組成
          <script language="Javascript"><!--
          function checkNum(str){
          return str.match(//D/)==null}
          alert(checkNum("1232142141"))
          alert(checkNum(
          "123214214a1"))
          // --></script>


          29. 獲得一個窗口的大小
          document.body.clientWidth; document.body.clientHeight


          30. 怎么判斷是否是字符
          if (/[^/x00-/xff]/g.test(s)) alert("含有漢字");
          else alert("全是字符");


          31.TEXTAREA自適應文字行數(shù)的多少
          <textarea rows=1 name=s1 cols=27 onpropertychange
          ="this.style.posHeight=this.scrollHeight">
          </textarea>


          32. 日期減去天數(shù)等于第二個日期
          <script language=Javascript>
          function cc(dd,dadd)
          {
          //可以加上錯誤處理
          var a = new Date(dd)
          = a.valueOf()
          = a - dadd * 24 * 60 * 60 * 1000
          = new Date(a)
          alert(a.getFullYear() 
          + "" + (a.getMonth() + 1+ "" + a.getDate() + "")
          }
          cc(
          "12/23/2002",2)
          </script>


          33. 選擇了哪一個Radio
          <HTML><script language="vbscript">
          function checkme()
          for each ob in radio1
          if ob.checked then
          window.alert ob.value
          next
          end function
          </script><BODY>
          <INPUT name="radio1" type="radio" value="/style" checked>Style
          <INPUT name="radio1" type="radio" value="/blog/barcode">Barcode
          <INPUT type="button" value="check" onclick="checkme()">
          </BODY></HTML>


          34.腳本永不出錯
          <SCRIPT LANGUAGE="JavaScript">
          <!-- Hide
          function killErrors() {
          return true;
          }
          window.onerror 
          = killErrors;
          // -->
          </SCRIPT>


          35.ENTER鍵可以讓光標移到下一個輸入框
          <input onkeydown="if(event.keyCode==13)event.keyCode=9">
          posted on 2008-06-25 13:29 onlyfish 閱讀(1748) 評論(0)  編輯  收藏

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


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 昌邑市| 沁水县| 崇阳县| 无极县| 崇信县| 平和县| 金塔县| 张家口市| 九龙县| 丰县| 四会市| 长宁县| 会理县| 武清区| 宝应县| 芜湖市| 德州市| 札达县| 梓潼县| 绥化市| 宁武县| 中西区| 拉萨市| 县级市| 宜章县| 长汀县| 威宁| 米林县| 诏安县| 贞丰县| 浙江省| 上思县| 阿尔山市| 西畴县| 青铜峡市| 神池县| 博客| 富裕县| 梅河口市| 龙岩市| 丰县|