Javascript獲取各種瀏覽器可見視窗大小

2021-09-01 09:43:31 字數 453 閱讀 1823

網頁可見區域寬:document.body.clientwidth;

網頁可見區域高:document.body.clientheight;

網頁可見區域寬:document.body.offsetwidth (包括邊線和滾動條的寬)";

網頁可見區域高:document.body.offsetheight(包括邊線的寬)";

網頁正文全文寬:document.body.scrollwidth;

網頁正文全文高:document.body.scrollheight;

網頁被卷去的高(ff):document.body.scrolltop;

網頁被卷去的高(ie): document.documentelement.scrolltop;

網頁被卷去的左: document.body.scrollleft;

網頁正文部分上: window.screentop;

javascript 各種禁用

1.文字框輸入限制 實現限制輸入大 小寫英文,數字,浮點小數,日期,中文,部分英文,部分中文等眾多功能。直接加入到html 中即可使用。function reginput obj,reg,inputstr 小寫英文 onpaste return reginput this,a z window.cl...

javascript獲取型別

1 使用typeof函式可以用於識別運算數型別的字串,可以返回如下型別 number,string,boolenan,object,function,undefined.2 當使用typeof函式檢測null值時,返回的時object,則需要 return o null null typeof o ...

JavaScript屬性獲取

一 操作標籤的合法屬性 合法屬性 比如id class title href src等。獲取合法屬性 獲取元素之後,直接使用點語法。修改合法屬性 獲取元素之後,用等號賦值,修改已有屬性。新增合法屬性 直接等號賦值。id box title 你好 你好嗎?div var title document....