锘??xml version="1.0" encoding="utf-8" standalone="yes"?> Firebug鏄綉欏靛紑鍙戠殑鍒╁櫒錛岃兘澶熸瀬澶у湴鎻愬崌宸ヤ綔鏁堢巼銆?br /> 浣嗘槸錛屽畠涓嶅お瀹規(guī)槗涓婃墜銆傛垜鏇劇粡緲昏瘧榪囦竴綃?a target="_blank" style="color: #1a356e; text-decoration: initial;">銆奆irebug鍏ラ棬鎸囧崡銆?/a>錛屼粙緇嶄簡涓浜涘熀鏈敤娉曘備粖澶╋紝緇х畫浠嬬粛瀹冪殑楂樼駭鐢ㄦ硶銆?/p> =================================== Firebug鎺у埗鍙拌瑙?/strong> 浣滆咃細闃竴宄?br />鍑哄錛歨ttp://www.ruanyifeng.com/blog/2011/03/firebug_console_tutorial.html 涓銆佹樉紺轟俊鎭殑鍛戒護 Firebug鍐呯疆涓涓猚onsole瀵硅薄錛屾彁渚?縐嶆柟娉曪紝鐢ㄦ潵鏄劇ず淇℃伅銆?/p> 鏈綆鍗曠殑鏂規(guī)硶鏄痗onsole.log()錛屽彲浠ョ敤鏉ュ彇浠lert()鎴杁ocument.write()銆傛瘮濡傦紝鍦ㄧ綉欏佃剼鏈腑浣跨敤console.log("Hello World")錛屽姞杞芥椂鎺у埗鍙板氨浼氳嚜鍔ㄦ樉紺哄涓嬪唴瀹廣?/p> 鍙﹀錛屾牴鎹俊鎭殑涓嶅悓鎬ц川錛宑onsole瀵硅薄榪樻湁4縐嶆樉紺轟俊鎭殑鏂規(guī)硶錛屽垎鍒槸涓鑸俊鎭痗onsole.info()銆侀櫎閿欎俊鎭痗onsole.debug()銆佽鍛婃彁紺篶onsole.warn()銆侀敊璇彁紺篶onsole.error()銆?/p> 姣斿錛屽湪緗戦〉鑴氭湰涓彃鍏ヤ笅闈㈠洓琛岋細 銆銆console.info("榪欐槸info"); 銆銆console.debug("榪欐槸debug"); 銆銆console.warn("榪欐槸warn"); 銆銆console.error("榪欐槸error"); 鍔犺澆鏃訛紝鎺у埗鍙頒細鏄劇ず濡備笅鍐呭銆?/p> 鍙互鐪嬪埌錛屼笉鍚屾ц川鐨勪俊鎭墠闈㈡湁涓嶅悓鐨勫浘鏍囷紝騫朵笖姣忔潯淇℃伅鍚庨潰閮芥湁瓚呯駭閾炬帴錛岀偣鍑誨悗璺寵漿鍒扮綉欏墊簮鐮佺殑鐩稿簲琛屻?/p> 浜屻佸崰浣嶇 console瀵硅薄鐨勪笂闈?縐嶆柟娉曪紝閮藉彲浠ヤ嬌鐢╬rintf椋庢牸鐨勫崰浣嶇銆備笉榪囷紝鍗犱綅絎︾殑縐嶇被姣旇緝?yōu)畱锛屽彧鏀寔瀛椊W︼紙%s錛夈佹暣鏁幫紙%d鎴?i錛夈佹誕鐐規(guī)暟錛?f錛夊拰瀵硅薄錛?o錛夊洓縐嶃?/p> 姣斿錛?/p> 銆銆console.log("%d騫?d鏈?d鏃?,2011,3,26); 銆銆console.log("鍦嗗懆鐜囨槸%f",3.1415926); %o鍗犱綅絎︼紝鍙互鐢ㄦ潵鏌ョ湅涓涓璞″唴閮ㄦ儏鍐點傛瘮濡傦紝鏈夎繖鏍蜂竴涓璞★細 銆銆var dog = {} ; 銆銆dog.name = "澶ф瘺" ; 銆銆dog.color = "榛勮壊"; 鐒跺悗錛屽瀹冧嬌鐢╫%鍗犱綅絎︺?/p> 銆銆console.log("%o",dog); 涓夈佸垎緇勬樉紺?/strong> 濡傛灉淇℃伅澶錛屽彲浠ュ垎緇勬樉紺猴紝鐢ㄥ埌鐨勬柟娉曟槸console.group()鍜宑onsole.groupEnd()銆?/p> 銆銆console.group("絎竴緇勪俊鎭?); 銆銆銆銆console.log("絎竴緇勭涓鏉?); 銆銆銆銆console.log("絎竴緇勭浜屾潯"); 銆銆console.groupEnd(); 銆銆console.group("絎簩緇勪俊鎭?); 銆銆銆銆console.log("絎簩緇勭涓鏉?); 銆銆銆銆console.log("絎簩緇勭浜屾潯"); 銆銆console.groupEnd(); 鐐瑰嚮緇勬爣棰橈紝璇ョ粍淇℃伅浼氭姌鍙犳垨灞曞紑銆?/p> 鍥涖乧onsole.dir() console.dir()鍙互鏄劇ず涓涓璞℃墍鏈夌殑灞炴у拰鏂規(guī)硶銆?/p> 姣斿錛岀幇鍦ㄤ負絎簩鑺傜殑dog瀵硅薄錛屾坊鍔犱竴涓猙ark()鏂規(guī)硶銆?/p> 銆銆dog.bark = function(){alert("姹豹姹?);}; 鐒跺悗錛屾樉紺鴻瀵硅薄鐨勫唴瀹癸紝 銆銆console.dir(dog); 浜斻乧onsole.dirxml() console.dirxml()鐢ㄦ潵鏄劇ず緗戦〉鐨勬煇涓妭鐐癸紙node錛夋墍鍖呭惈鐨刪tml/xml浠g爜銆?/p> 姣斿錛屽厛鑾峰彇涓涓〃鏍艱妭鐐癸紝 銆銆var table = document.getElementById("table1"); 鐒跺悗錛屾樉紺鴻鑺傜偣鍖呭惈鐨勪唬鐮併?/p> 銆銆console.dirxml(table); 鍏乧onsole.assert() console.assert()鐢ㄦ潵鍒ゆ柇涓涓〃杈懼紡鎴栧彉閲忔槸鍚︿負鐪熴傚鏋滅粨鏋滀負鍚︼紝鍒欏湪鎺у埗鍙拌緭鍑轟竴鏉$浉搴斾俊鎭紝騫朵笖鎶涘嚭涓涓紓甯搞?/p> 姣斿錛屼笅闈袱涓垽鏂殑緇撴灉閮戒負鍚︺?/p> 銆銆var result = 0; 銆銆console.assert( result ); 銆銆var year = 2000; 銆銆console.assert(year == 2011 ); 涓冦乧onsole.trace() console.trace()鐢ㄦ潵榪借釜鍑芥暟鐨勮皟鐢ㄨ建榪廣?/p> 姣斿錛屾湁涓涓姞娉曞櫒鍑芥暟銆?/p> 銆銆function add(a,b){ 銆銆銆銆return a+b; 銆銆} 鎴戞兂鐭ラ亾榪欎釜鍑芥暟鏄浣曡璋冪敤鐨勶紝鍦ㄥ叾涓姞鍏onsole.trace()鏂規(guī)硶灝卞彲浠ヤ簡銆?/p> 銆銆function add(a,b){ 銆銆銆銆console.trace(); 銆銆銆銆return a+b; 銆銆} 鍋囧畾榪欎釜鍑芥暟鐨勮皟鐢ㄤ唬鐮佸涓嬶細 銆銆var x = add3(1,1); 銆銆function add3(a,b){return add2(a,b);} 銆銆function add2(a,b){return add1(a,b);} 銆銆function add1(a,b){return add(a,b);} 榪愯鍚庯紝浼氭樉紺篴dd()鐨勮皟鐢ㄨ建榪癸紝浠庝笂鍒頒笅渚濇涓篴dd()銆乤dd1()銆乤dd2()銆乤dd3()銆?/p> 鍏佽鏃跺姛鑳?/strong> console.time()鍜宑onsole.timeEnd()錛岀敤鏉ユ樉紺轟唬鐮佺殑榪愯鏃墮棿銆?/p> 銆銆console.time("璁℃椂鍣ㄤ竴"); 銆銆for(var i=0;i<1000;i++){ 銆銆銆銆for(var j=0;j<1000;j++){} 銆銆} 銆銆console.timeEnd("璁℃椂鍣ㄤ竴"); 涔?jié)銆佹ц兘鍒嗘瀽 鎬ц兘鍒嗘瀽錛圥rofiler錛夊氨鏄垎鏋愮▼搴忓悇涓儴鍒嗙殑榪愯鏃墮棿錛屾壘鍑虹摱棰堟墍鍦紝浣跨敤鐨勬柟娉曟槸console.profile()銆?/p> 鍋囧畾鏈変竴涓嚱鏁癋oo()錛岄噷闈㈣皟鐢ㄤ簡鍙﹀涓や釜鍑芥暟funcA()鍜宖uncB()錛屽叾涓璮uncA()璋冪敤10嬈★紝funcB()璋冪敤1嬈°?/p> 銆銆function Foo(){ 銆銆銆銆for(var i=0;i<10;i++){funcA(1000);} 銆銆銆銆funcB(10000); 銆銆} 銆銆function funcA(count){ 銆銆銆銆for(var i=0;i<count;i++){} 銆銆} 銆銆function funcB(count){ 銆銆銆銆for(var i=0;i<count;i++){} 銆銆} 鐒跺悗錛屽氨鍙互鍒嗘瀽Foo()鐨勮繍琛屾ц兘浜嗐?/p> 銆銆console.profile('鎬ц兘鍒嗘瀽鍣ㄤ竴'); 銆銆Foo(); 銆銆console.profileEnd(); 鎺у埗鍙頒細鏄劇ず涓寮犳ц兘鍒嗘瀽琛紝濡備笅鍥俱?/p> 鏍囬鏍忔彁紺猴紝涓鍏辮繍琛屼簡12涓嚱鏁幫紝鍏辮楁椂2.656姣銆傚叾涓璮uncA()榪愯10嬈★紝鑰楁椂1.391姣錛屾渶鐭繍琛屾椂闂?.123姣錛屾渶闀?.284姣錛屽鉤鍧?.139姣錛沠uncB()榪愯1嬈★紝鑰楁椂1.229ms姣銆?/p> 闄や簡浣跨敤console.profile()鏂規(guī)硶錛宖irebug榪樻彁渚涗簡涓涓?姒傚喌"錛圥rofiler錛夋寜閽傜涓嬈$偣鍑昏鎸夐挳錛?鎬ц兘鍒嗘瀽" 寮濮嬶紝浣犲彲浠ュ緗戦〉榪涜鏌愮鎿嶄綔錛堟瘮濡俛jax鎿嶄綔錛夛紝鐒跺悗絎簩嬈$偣鍑昏鎸夐挳錛?鎬ц兘鍒嗘瀽"緇撴潫錛岃鎿嶄綔寮曞彂鐨勬墍鏈夎繍綆楀氨浼氳繘琛屾ц兘鍒嗘瀽銆?/p> 鍗併佸睘鎬ц彍鍗?/strong> 鎺у埗鍙伴潰鏉跨殑鍚嶇О鍚庨潰錛屾湁涓涓掍笁瑙掞紝鐐瑰嚮鍚庝細鏄劇ず灞炴ц彍鍗曘?/p> 榛樿鎯呭喌涓嬶紝鎺у埗鍙板彧鏄劇ずJavascript閿欒銆傚鏋滈変腑Javascript璀﹀憡銆丆SS閿欒銆乆ML閿欒閮介佷笂錛屽垯鐩稿叧鐨勬彁紺轟俊鎭兘浼氭樉紺恒?/p> 榪欓噷姣旇緝鏈夌敤鐨勬槸"鏄劇ずXMLHttpRequests"錛屼篃灝辨槸鏄劇ずajax璇鋒眰銆傞変腑浠ュ悗錛岀綉欏電殑鎵鏈塧jax璇鋒眰錛岄兘浼氬湪鎺у埗鍙伴潰鏉挎樉紺哄嚭鏉ャ?/p> 姣斿錛岀偣鍑諱竴涓?a target="_blank" style="color: #1a356e; text-decoration: initial;">YUI紺轟緥錛屾帶鍒跺彴灝變細鍛婅瘔鎴戜滑錛屽畠鐢╝jax鏂瑰紡鍙戝嚭浜嗕竴涓狦ET璇鋒眰錛宧ttp璇鋒眰鍜屽搷搴旂殑澶翠俊鎭拰鍐呭涓諱綋錛屼篃閮藉彲浠ョ湅鍒般?/p> [鍙傝冩枃鐚甝 * Firebug Tutorial - Logging, Profiling and CommandLine (Part I) * Firebug Tutorial - Logging, Profiling and CommandLine (Part II) 錛堝畬錛?/p> 鍦‥XTJS瀹樼綉鐪嬪埌涓鐗囨枃绔狅紝璁茬殑鏄疎xtjs.Loader鐨勪嬌鐢ㄦ柟娉曪紝鏂囩珷闈炲父璇︾粏鐨勪粙緇嶄簡 Loader鐨勬満鍒跺強鐢ㄦ硶錛屾劅瑙夐潪甯鎬笉閿欙紝浣嗘棤濂堣嫳鏂囧疄鍦ㄥお鐑傦紝灝辨病杞繃鏉ャ傛槰澶╂伆濂藉湪CSDN鐪嬪埌浜嗚繖綃囨枃绔犵殑璇戞枃錛岃岃瘧鏂囩殑璐ㄩ噺闈炲父楂橈紝瀵硅瘧鑰呯殑緲昏瘧 姘村鉤鎬庝竴涓盡鎱曚簡寰椼傚簾璇濅笉澶氳錛屾鏂囧紑濮嬨?/p> 鍦ㄥ紑濮嬩箣鍓嶏紝灝嗚嫳鏂囧師鏂囬摼鎺ユ斁涓婃潵錛岃嫳鏂囨按騫抽珮鐨勫彲浠ョ湅鐪嬪師鏂囧摝銆?/p> 閾炬帴鍦板潃錛?a target="_blank" >www.sencha.com/blog/using-ext-loader-for-your-application/ ExtJS 4.0鏄竴涓嬌鐢ㄦ柊鐨勪緷璧栫郴緇熺殑綾誨姞杞界郴緇熴傝繖涓や釜寮哄ぇ鐨勬柊鍔熻兘鍏佽浣犲垱寤哄ぇ閲忓厑璁告祻瑙堝櫒鎸夐渶涓嬭澆鑴氭湰浠g爜鐨勫簲鐢ㄣ?/p> 浠婂ぉ錛屾垜浠皢閫氳繃寤虹珛涓涓皬鐨勪嬌鐢ㄦ柊鐨勭被鍔犺澆緋葷粺鐨勫簲鐢ㄧ▼搴忔潵鐔熸?zhèn)変竴涓嬩緷璧栫鐞嗙郴緇熴傚悓鏃訛紝鎴戜滑灝嗚璁篍xt鍔犺澆緋葷粺鐨勫悇縐嶉厤緗」銆?/p> 鍦ㄥ紑濮嬩箣鍓嶏紝鎴戜滑鍏堟潵鐪嬬湅灝嗚瀹炵幇鐨勭粨鏋溿傝繖鏍峰仛錛屽彲浣挎垜浠‘瀹氶渶瑕佹墿灞曢偅浜涚被銆?/p> 搴旂敤浼氬寘鎷簰鐩哥粦瀹氱殑GridPanel鍜孎ormPanel錛屽悕縐板垎鍒負UserGridPanel鍜孶serFormPanel銆?UserGridPanel鐨勬搷浣滈渶瑕佸垱寤轟竴涓ā鍨嬪拰Store銆俇serGridPanel鍜孶serFormPanel灝嗚娓叉煋鍒頒竴涓悕縐頒負 UserEditorWindow鐨勭獥鍙o紝瀹冩墿寮犺嚜ExtJS鐨刉indow綾匯傛墍鏈夎繖浜涚被閮戒細鍦ㄥ懡鍚嶇┖闂碝yApp涓嬨?/p> 鍦ㄥ紑濮嬬紪鐮佸墠錛岄鍏堣紜畾鐩綍緇撴瀯錛屼互涓嬫槸浣跨敤鍛藉悕絀洪棿緇勭粐鐨勬枃浠跺す錛?/p> 浠庝笂鍥懼彲浠ョ湅鍒幫紝MyApp鐩綍宸茬粡鎸夌収鍛藉悕絀洪棿榪涙媶鍒嗘垚鍑犱釜鐩綍銆傚湪瀹屾垚寮鍙戠殑鏃跺欙紝鎴戜滑鐨勫簲鐢ㄥ皢浼氭湁涓涓涓嬪浘鎵紺虹殑鍐呴儴渚濊禆榪愯妯″瀷銆?/p> 錛?span style="font-family: 瀹嬩綋; color: #ff0000">灝界搴旂敤鐨勭洰褰曟瀯鎴愬緢璞xtJS 4 MVC鏋舵瀯錛屼簨瀹炰笂紺轟緥騫舵病鏈変嬌鐢ㄥ畠 錛?/p> 鐜板湪寮濮嬬紪鍐檌ndex.html鏂囦歡錛岃繖閲岄渶瑕佸寘鍚簲鐢ㄩ渶瑕佺殑鍚姩鏂囦歡鍜屽簲鐢ㄧ殑鏍規(guī)枃浠?app.js)銆?/p> index.html鏂囦歡涓渶瑕佷嬌鐢╨ink鏍囪鍖呭惈ExtJS 4鐨勬牱寮忔枃浠躲傚寘鍚玡xt-debug.js鏂囦歡鐨刯avascript鏍囪鍙兘瑕佷慨鏀瑰嬈★紝ext-all-debug.js鏂囦歡鏄紑鍙戣皟璇曠敤鐨勶紝鑰宔xt-all.js鍒欐槸鍦ㄥ彂甯冧駭鍝佹椂浣跨敤鐨勩?/p> 榪欓噷鏈夊嚑涓夋嫨錛屾瘡涓夋嫨閮芥湁浼樼己鐐廣?/p> 浠ヤ笅鏄繖浜涙枃浠剁殑璇存槑錛?/p> ext-all-debug-w-comments.js錛氬甫娉ㄩ噴鐨勭殑瀹屾暣璋冭瘯鐗堟湰銆傛枃浠舵瘮杈冨ぇ錛屽姞杞芥椂闂存瘮杈冮暱銆?/p> ext-all-debug.js : 涓嶅甫娉ㄩ噴鐨勫畬鏁磋皟璇曠増鏈傛枃浠朵篃姣旇緝澶э紝浣嗗緢閫傚悎璋冭瘯銆?/p> ext-all.js 錛涘帇緙╁悗鐨勫畬鏁寸増鏈紝鏂囦歡姣旇緝?yōu)畯銆備嬌鐢ㄨ鐗堟湰璋冭瘯寰堝洶闅撅紝鍥犳涓鑸湪鍙戝竷浜у搧鏃舵墠浣跨敤銆?/p> ext-debug.js 錛?璇ユ枃浠跺彧鍖呭惈ExtJS鍩虹鏋舵瀯鍜岀┖鐨勭粨鏋勩備嬌鐢ㄨ鏂囦歡錛屽彲浠ュ疄鐜癊xtJS綾繪枃浠剁殑榪滅▼鍔犺澆錛岃屼笖鎻愪緵浜嗗緢濂界殑璋冭瘯浣撻獙錛屼笉榪囦唬浠鋒槸鐩稿綋鐨勬參銆?/p> ext.js : ext-debug.js鐨勫帇緙╃増鏈?/p> 鎴戜滑鐨刬ndex.html灝嗕嬌鐢╡xt-debug.js鏂囦歡錛岃繖鏄疄鐜板姩鎬佸姞杞芥墍闇鐨勬渶浣庤姹傘傛渶鍚庯紝鎴戜滑灝嗗睍紺哄浣曚嬌鐢╡xt-all鐗堟湰鑾峰彇鏈濂界殑緇撴灉銆?/p> 鐢變簬UserGridPanel 綾昏姹傛ā鍨嬪拰Store錛屽洜鑰岋紝瑕佸厛瀹氫箟緙栧啓榪欎簺鏀寔綾匯傜幇鍦ㄥ紑濮嬬紪鍐欐ā鍨嬪拰Store錛?/p> 浠ヤ笂浠g爜鎵╁睍鑷狤xt.data.Model錛屽皢鍒涘緩UserModel 綾匯傚洜涓烘墿灞曡嚜Ext.data.Model綾伙紝ExtJS浼氳嚜鍔ㄥ姞杞藉畠錛屽茍鍦ㄥ畠鍔犺澆鍚庡垱寤篣serModel綾匯?/p> 涓嬩竴姝ワ紝瑕佸垱寤烘墿灞曡嚜Ext.data.Store鐨刄serStore 綾伙細 褰撳垱寤哄崟浠舵ā寮忕殑UserStore 鏃訛紝闇瑕佸湪UserStore鍘熷瀷娣誨姞涓涓猺equires鍏抽敭瀛楋紝瀹冧細鍦ㄧ被瀹炰緥鍖栧墠錛屼負ExtJS鎻愪緵涓涓被鐨勮姹傚垪琛ㄣ傚湪榪欎釜紺轟緥錛屽垪琛ㄤ腑鍙湁UserModel 涓涓姹傜被銆?/p> 錛堝疄闄呬笂錛?鍦⊿tore鐨勫師鍨嬩腑瀹氫箟浜唌odel涓篣serModel 綾伙紝ExtJS灝變細鑷姩鍔犺澆瀹冦傚湪requires鍏抽敭瀛椾腑鍒楀嚭鐨勭洰鐨勶紝鏄笇鏈涗綘鐨勪唬鐮佽兘鑷枃妗e寲錛坰elf-documenting錛夛紝浠庤屾彁閱掍綘錛孶serModel 綾繪槸蹇呴』鐨?錛?/p> 濂戒簡錛孶serGridPanel瑙嗗浘闇瑕佺殑鍩虹被宸茬粡鍒涘緩浜嗭紝鐜板湪鍙互鍒涘緩UserGridPanel綾諱簡錛?/p> 鍦ㄤ笂闈唬鐮佷腑錛岃娉ㄦ剰requires 鍏抽敭瀛楋紝鐪嬪畠鏄庝箞澧炲姞UserStore 涓鴻姹傜被鐨勩傚垰鎵嶏紝鎴戜滑涓篏ridPanel鎵╁睍鍜孲tore鎵╁睍閰嶇疆浜嗕竴涓洿鎺ョ殑渚濊禆鍏崇郴銆?/p> 涓嬩竴姝ワ紝鎴戜滑瑕佸垱寤篎ormPanel鎵╁睍錛?/p> 鍥犱負UserForm 涓嶉渶瑕佷粠鏈嶅姟鍣ㄧ璇鋒眰浠諱綍綾伙紝鍥犺屼笉闇瑕佹坊鍔爎equires瀹氫箟銆?/p> 搴旂敤蹇畬鎴愪簡錛岀幇鍦ㄩ渶瑕佸垱寤篣serEditorWindow綾誨拰榪愯搴旂敤鐨刟pp.js銆備互涓嬫槸UserEditorWindow綾葷殑浠g爜銆傚洜涓鴻灝咷rid鍜岃〃鍗曠粦瀹氬湪涓璧鳳紝鍥犺岀被浠g爜鏈夌偣闀匡紝璇瘋璋咃細 UserEditorWindow 鐨勪唬鐮佸寘鍚簡璁稿涓滆タ鐢ㄦ潵綆$悊UserGridPanel鍜孶serFormPanel綾葷殑鏁翠釜緇戝畾鐨勫0鏄庡懆鏈熴備負浜嗘寚紺篍xtJS鍦ㄥ垱寤鴻綾誨墠鍔犺澆榪欎袱涓被錛屽繀欏誨湪requires鍒楄〃閲屽垪鍑哄畠浠?/p> 鐜板湪瀹屾垚鏈鍚庝竴涓枃浠禷pp.js銆備負浜嗘渶澶ч檺搴﹀湴鎻愰珮鎴戜滑鐨勫涔狅紝灝嗘湁3嬈′慨鏀硅鍋氥傞鍏堜粠鏈綆鍗曢厤緗紑濮嬶紝鐒跺悗閫愭娣誨姞銆?/p> 棣栧厛錛宎pp.js浼氬湪ExtJS娣誨姞MyApp鍛藉悕絀洪棿鐨勮礬寰勶紝榪欏彲閫氳繃璋冪敤Ext.loader.setPath鏂規(guī)硶瀹炵幇錛屾柟娉曠殑絎?涓弬鏁版槸鍛藉悕絀洪棿錛岀劧鍚庢槸鍔犺澆鏂囦歡涓庨〉闈㈢殑鐩稿璺緞銆?/p> 涓嬩竴姝ワ紝璋冪敤Ext.OnReady鏂規(guī)硶錛屼紶閫掍竴涓寘鍚獷xt.create鐨勫尶鍚嶅嚱鏁般侲xt.create浼氬湪ExtJS 4.0鍒濆鍖栦箣鍚庢墽琛岋紝浠ュ瓧絎︿覆褰㈠紡浼犻掔殑UserEditorWindow 綾諱細琚疄渚嬪寲銆傚洜涓轟笉闇瑕佹寚鍚戝疄渚嬪拰甯屾湜绔嬪嵆鏄劇ず瀹冿紝鍥犺屽湪鍚庨潰涓叉帴浜唖how鏂規(guī)硶鐨勮皟鐢ㄣ?/p> 濡傛灉浣犳墦寮榪欎釜欏甸潰錛?a >http://moduscreate.com/senchaarticles/01/pass1.html 錛夛紝浣犱細鐪嬪埌UI娓叉煋錛屼絾寰堟參錛屽茍涓擡xtJS浼氬湪Firebug涓樉紺轟互涓嬭鍛婁俊鎭細 ExtJS鎻愮ず鎴戜滑娌℃湁浣跨敤鍔犺澆緋葷粺鏈浼樺寲鐨勬柟寮忋傝繖鏄浜屾瑕佽璁虹殑闂銆傜劧鍚庯紝榪欐槸涓涓ソ鐨勫涔犳満浼氾紝瑕佸ソ濂界悊鐢便?/p> 鎴戜滑闇瑕侀厤緗瓼irebug鍦ㄦ帶鍒跺彴涓樉紺篨HR璇鋒眰錛屼互渚垮湪鎺у埗鍙頒腑鐪嬪埌鎵鏈夎姹傦紝鑰屼笉闇瑕佸垏鎹㈠埌緗戠粶闈㈡澘銆傝繖鏍鳳紝鎴戜滑涓嶅崟鍙互瑙傚療鍒扮被渚濊禆緋葷粺鐨勫伐浣滄儏鍐碉紝榪樺彲浠ヤ粠鎵鏈塃xtJS綾誨姞杞界殑鏂囦歡涓氳繃榪囨護鏂瑰紡鎵懼埌鎴戜滑瑕佹眰榪欐牱鐨勬枃浠躲?/p> 鍦‵irebug鎺у埗鍙拌繃婊よ緭鍏ユ涓緭鍏?#8220;User”錛屼綘浼氱湅鍒頒笅鍥炬墍紺虹殑緇撴灉銆?/p> 鎴戝垰鎵嶆彁鍒幫紝ExtJS鎻愮ず浜嗘垜浠病鏈変嬌鐢ㄥ姞杞界郴緇熸渶浼樺寲鐨勬柟寮忋傝繖鏄洜涓轟緷璧栨槸鍦‥xt.OnReady瑙﹀彂鍔犺澆涔嬪悗閫氳繃鍚屾XHR璇鋒眰紜畾鐨勶紝鑰岃繖涓嶆槸鏈夋晥鐨勬柟寮忎笖闅句簬璋冭瘯銆?/p> 鏈潵淇榪欎釜闂錛屽彲浠ヤ慨鏀筧pp.js鎸囩ずExtJS鍏堝姞杞芥垜浠畾涔夌殑綾伙紝榪欐牱鍗沖彲鎻愪緵鎬ц兘鍙堜究浜庤皟璇曪細 涓轟簡蹇熷姞杞芥垜浠畾涔夌殑綾誨拰閬垮厤璋冭瘯淇℃伅錛屽彲綆鍗曠殑鍦‥xt.onReady鍓嶈皟鐢‥xt.require錛屽彧鏄疎xtJS璇鋒眰 UserEditorWindow綾匯傝繖灝嗕細璁〦xtJS鍦ㄦ枃妗EAD鏍囪鍐呮敞鍏ヤ竴涓猻cript鏍囪錛岃繍琛岃祫婧愬湪Ext.OnReady鍓嶅姞杞姐?/p> 鏌ョ湅http://moduscreate.com/senchaarticles/01/pass2.html 鍙湅鍒板畠鏄浣曞伐浣滃湴銆傚湪欏甸潰鍔犺澆鍚庯紝浣犱細娉ㄦ剰鍒癊xtJS娌℃湁鍦ㄦ帶鍒跺彴鏄劇ず璀﹀憡淇℃伅浜嗐?/p> 鎴戜滑鎵鍋氱殑鏄ExtJS妗嗘灦鍜屽簲鐢ㄧ被寤惰繜鍔犺澆銆傝櫧鐒惰繖鏍峰仛璋冭瘯寰堝ソ錛屼絾鏄浜庨渶瑕佸揩閫熻皟璇曠殑鎯呭喌錛岄〉闈㈡覆鏌撴椂闂翠細璁╀綘鎰熷埌鐥涜嫤銆備負浠涔堬紵 鍘熷洜寰堢畝鍗曪紝鍥犱負榪欓渶瑕佸姞杞借澶氳祫婧愭枃浠躲傚湪紺轟緥涓紝ExtJS鍙戦佷簡193涓狫avascript璧勬簮璇鋒眰鍒皐eb鏈嶅姟鍣紝榪樻湁閮ㄥ垎鏄湪緙撳瓨涓殑錛?/p> 鎴戜滑鍒涘緩浜?涓狫avascript鏂囦歡錛?涓被鏂囦歡鍜宎pp.js錛夛紝榪欐剰鍛崇潃鍔犺澆瑕佹眰鐨凟xtJS鏂囦歡鏈?87涓姹傘傚綋浣犲湪鏈湴鍋氬紑鍙戠殑鏃跺欙紝榪欎釜鏂規(guī)鍙錛屼絾涓嶆槸鏈鐞嗘兂鐨勫拰鏁堟灉鏈濂界殑銆?/p> 瑙e喅榪欎釜闂錛屾垜浠彲浠ヤ嬌鐢ㄦ姌涓柟妗堬紝閫氳繃ext-all-debug鍔犺澆ExtJS妗嗘灦錛屽姩鎬佸姞杞芥垜浠殑綾繪枃浠躲傝瀹炵幇榪欎釜錛岄渶瑕佷慨鏀逛袱涓枃浠躲?/p> 棣栧厛錛岄渶瑕佷慨鏀笽ndex.html錛屼嬌鐢╡xt-all-debug.js鏇挎崲ext.debug.js銆?/p> 鎺ョ潃錛屼慨鏀筧pp.js錛屽紑鍚疎xt.Loader錛?/p> 閫氳繃璋冪敤Loader.setConfig鍙紑鍚疎xt.Loader錛岄渶瑕佷紶閫掍竴涓尶鍚嶅璞★紝瀹冪殑eanbled灞炴ц緗負true錛岃屽懡鍚嶇┖闂磋緗負璺緞鏄犲皠銆?/p> 閫氳繃緙栬緫app.js錛屽湪鏈湴寮鍙戠幆澧冧笅錛屽簲鐢ㄥ皢浼氬湪1縐掑唴瀹屾垚鍔犺澆鍜屾覆鏌撱?/p> 婧愪唬鐮佷笅杞藉湴鍧錛?a title="http://moduscreate.com/senchaarticles/01/files.zip" >http://moduscreate.com/senchaarticles/01/files.zip 璇戞枃閾炬帴鍦板潃錛?a target="_blank" >blog.csdn.net/tianxiaode/archive/2011/06/28/6571589.aspx 瑙f瀽鏁版嵁 XML 瑙f瀽鍣ㄩ氬父鎯呭喌涓嬩細澶勭悊XML鏂囨。涓殑鎵鏈夋枃鏈?/p>
褰揦ML鍏冪礌琚В鏋愮殑鏃跺欙紝XML鍏冪礌鍐呴儴鐨勬枃鏈篃浼氳瑙f瀽銆?/p>
涓嬮潰鏄簲涓湪XML鏂囨。涓瀹氫箟濂界殑瀹炰綋: 涓涓?CDATA 閮ㄤ歡浠?<![CDATA[" 鏍囪寮濮嬶紝浠?]]>"鏍囪緇撴潫 鎵鏈夊湪CDATA閮ㄤ歡涔嬮棿鐨勬枃鏈兘浼氳瑙f瀽鍣ㄥ拷鐣ャ?/p>
CDATA娉ㄦ剰浜嬮」: CDATA閮ㄤ歡涔嬮棿涓嶈兘鍐嶅寘鍚獵DATA閮ㄤ歡錛堜笉鑳藉祵濂楋級銆傚鏋淐DATA閮ㄤ歡鍖呭惈浜嗗瓧絎?]]>" 鎴栬?<![CDATA[" 錛屽皢寰堟湁鍙兘鍑洪敊銆?/p>
鍚屾牱瑕佹敞鎰忓湪瀛楃涓?]]>"涔嬮棿娌℃湁絀烘牸鎴栬呮崲琛岀銆?/p>
瑙f瀽鏁版嵁 XML 瑙f瀽鍣ㄩ氬父鎯呭喌涓嬩細澶勭悊XML鏂囨。涓殑鎵鏈夋枃鏈?/p>
褰揦ML鍏冪礌琚В鏋愮殑鏃跺欙紝XML鍏冪礌鍐呴儴鐨勬枃鏈篃浼氳瑙f瀽銆?/p>
涓嬮潰鏄簲涓湪XML鏂囨。涓瀹氫箟濂界殑瀹炰綋: 涓涓?CDATA 閮ㄤ歡浠?<![CDATA[" 鏍囪寮濮嬶紝浠?]]>"鏍囪緇撴潫 鎵鏈夊湪CDATA閮ㄤ歡涔嬮棿鐨勬枃鏈兘浼氳瑙f瀽鍣ㄥ拷鐣ャ?/p>
CDATA娉ㄦ剰浜嬮」: CDATA閮ㄤ歡涔嬮棿涓嶈兘鍐嶅寘鍚獵DATA閮ㄤ歡錛堜笉鑳藉祵濂楋級銆傚鏋淐DATA閮ㄤ歡鍖呭惈浜嗗瓧絎?]]>" 鎴栬?<![CDATA[" 錛屽皢寰堟湁鍙兘鍑洪敊銆?/p>
鍚屾牱瑕佹敞鎰忓湪瀛楃涓?]]>"涔嬮棿娌℃湁絀烘牸鎴栬呮崲琛岀銆?/p>
鎺у埗鍙幫紙Console錛夋槸Firebug鐨勭涓涓潰鏉匡紝涔熸槸鏈閲嶈鐨勯潰鏉匡紝涓昏浣滅敤鏄樉紺虹綉欏靛姞杞借繃紼嬩腑浜х敓鍚勭被淇℃伅銆?/p>浠庡浘涓彲浠ョ湅鍒幫紝UserEditorWindow綾葷涓涓鍔犺澆錛屾帴鐫璇鋒眰UserGridPanel銆俇serGridPanel 瑕佹眰UserStore鍜孶serModel綾匯傛渶鍚庡姞杞経serFormPanel 綾匯?/p>
鍩烘湰緇勪歡錛?/strong> xtype Class 鎻忚堪 button Ext.Button 鎸夐挳 splitbutton Ext.SplitButton 甯︿笅鎷夎彍鍗曠殑鎸夐挳 cycle Ext.CycleButton 甯︿笅鎷夐夐」鑿滃崟鐨勬寜閽?/td> buttongroup Ext.ButtonGroup 緙栫粍鎸夐挳(Since 3.0) slider Ext.Slider 婊戝姩鏉?/td> progress Ext.ProgressBar 榪涘害鏉?/td> statusbar Ext.StatusBar 鐘舵佹潯錛?.2鍔犺繘鏉ワ紝3.0 鍙堝幓浜?/td> colorpalette Ext.ColorPalette 璋冭壊鏉?/td> datepicker Ext.DatePicker 鏃ユ湡閫夋嫨闈㈡澘 瀹瑰櫒鍙婃暟鎹被緇勪歡 xtype Class 鎻忚堪 window Ext.Window 紿楀彛 viewport Ext.ViewPort 瑙嗗彛錛屽嵆嫻忚鍣ㄧ殑瑙嗗彛錛岃兘闅忎箣浼哥緝 box Ext.BoxComponent 鐩掑瓙緇勪歡錛岀浉褰撲簬涓涓?<div> component Ext.Component 緇勪歡 container Ext.Container 瀹瑰櫒 panel Ext.Panel 闈㈡澘 tabpanel Ext.TabPanel 閫夐」闈㈡澘 treepanel Ext.tree.TreePanel 鏍戝瀷闈㈡澘 flash Ext.FlashComponent 鏄劇ず Flash 鐨勭粍浠?Since 3.0) grid Ext.grid.GridPanel 琛ㄦ牸 editorgrid Ext.grid.EditorGridPanel 鍙紪杈戠殑琛ㄦ牸 propertygrid Ext.grid.PropertyGrid 灞炴ц〃鏍?/td> editor Ext.Editor 緙栬緫鍣?/td> dataview Ext.DataView 鏁版嵁鏄劇ず瑙嗗浘 listview Ext.ListView 鍒楄〃瑙嗗浘 宸ュ叿鏍忕粍浠訛細 xtype Class 鎻忚堪 paging Ext.PagingToolbar 鍒嗛〉宸ュ叿鏉?/td> toolbar Ext.Toolbar 宸ュ叿鏍?/td> tbbutton Ext.Toolbar.Button 宸ュ叿鏍忔寜閽?/td> tbfill Ext.Toolbar.Fill 宸ュ叿鏍忓~鍏呭尯 tbitem Ext.Toolbar.Item 宸ュ叿鏉¢」鐩?/td> tbseparator Ext.Toolbar.Separator 宸ュ叿鏍忓垎闅旂 tbspacer Ext.Toolbar.Spacer 宸ュ叿鏍忕┖鐧?/td> tbsplit Ext.Toolbar.SplitButton 宸ュ叿鏍忓垎闅旀寜閽?/td> tbtext Ext.Toolbar.TextItem 宸ュ叿鏍忔枃鏈」 鑿滃崟緇勪歡錛?/td> xtype Class 鎻忚堪 menu Ext.menu.Menu 鑿滃崟 colormenu Ext.menu.ColorMenu 棰滆壊閫夋嫨鑿滃崟 datemenu Ext.menu.DateMenu 鏃ユ湡閫夋嫨鑿滃崟 menubaseitem BaseItem menucheckitem Ext.menu.CheckItem 閫夐」鑿滃崟欏?/td> menuitem Ext.menu.Item menuseparator Ext.menu.Separator 鑿滃崟鍒嗛殧綰?/td> menutextitem Ext.menu.TextItem 鏂囨湰鑿滃崟欏?/td> 琛ㄥ崟鍙婅〃鍗曞煙緇勪歡錛?/td> xtype Class 鎻忚堪 form Ext.FormPanel/Ext.form.FormPanel 琛ㄥ崟闈㈡澘 checkbox Ext.form.Checkbox 澶氶夋 combo Ext.form.ComboBox 涓嬫媺妗?/td> datefield Ext.form.DateField 鏃ユ湡閫夋嫨欏?/td> timefield Ext.form.TimeField 鏃墮棿褰曞叆欏?/td> field Ext.form.Field 琛ㄥ崟瀛楁 fieldset Ext.form.FieldSet 琛ㄥ崟瀛楁緇?/td> hidden Ext.form.Hidden 琛ㄥ崟闅愯棌鍩?/td> htmleditor Ext.form.HtmlEditor HTML 緙栬緫鍣?/td> label Ext.form.Label 鏍囩 numberfield Ext.form.NumberField 鏁板瓧緙栬緫鍣?/td> radio Ext.form.Radio 鍗曢夋寜閽?/td> textarea Ext.form.TextArea 澶氳鏂囨湰妗?/td> textfield Ext.form.TextField 琛ㄥ崟鏂囨湰妗?/td> trigger Ext.form.TriggerField 瑙﹀彂褰曞叆欏?/td> checkboxgroup Ext.form.CheckboxGroup 緙栫粍鐨勫閫夋(Since 2.2) displayfield Ext.form.DisplayField 浠呮樉紺猴紝涓嶆牎楠?涓嶈鎻愪氦鐨勬枃鏈 radiogroup Ext.form.RadioGroup 緙栫粍鐨勫崟閫夋寜閽?Since 2.2) 鍥捐〃緇勪歡錛?/td> xtype Class 鎻忚堪 chart Ext.chart.Chart 鍥捐〃緇勪歡 barchart Ext.chart.BarChart 鏌辯姸鍥?/td> cartsianchart Ext.chart.CartesianChart columnchart Ext.chart.ColumnChart linechart Ext.chart.LineChart 榪炵嚎鍥?/td> piechart Ext.chart.PieChart 鎵囧艦鍥?/td> 鏁版嵁闆?Store錛?/td> xtype Class 鎻忚堪 arraystore Ext.data.ArrayStore directstore Ext.data.DirectStore groupingstore Ext.data.GroupingStore jsonstore Ext.data.JsonStore simplestore Ext.data.SimpleStore store Ext.data.Store xmlstore Ext.data.XmlStore 濡傛灉鏂囨湰涓惈鏈?#8220;<”錛?#8220;>”絳夌壒孌婄殑瀛楃鏃跺皢浼氬嚭鐜板紓甯搞傦紙褰撳惈鏈?#8220;錛?#8221;鏃訛紝DataSet.ReadXml涔熶細鍑虹幇寮傚父錛夈?/pre>
涓縐嶈В鍐蟲柟娉曟槸錛氱敤瀹炰綋&鏉ヨ〃紺恒?/pre>
<
<
灝忎簬鍙?/td>
>
>
澶т簬鍙?/td>
&
&
鍜?/td>
'
'
鍗曞紩鍙?/td>
"
"
鍙屽紩鍙?/td>
鍙︿竴縐嶈В鍐蟲柟娉曟槸浣跨敤CDATA閮ㄤ歡錛?/pre>
濡傛灉鏂囨湰涓惈鏈?#8220;<”錛?#8220;>”絳夌壒孌婄殑瀛楃鏃跺皢浼氬嚭鐜板紓甯搞傦紙褰撳惈鏈?#8220;錛?#8221;鏃訛紝DataSet.ReadXml涔熶細鍑虹幇寮傚父錛夈?/pre>
涓縐嶈В鍐蟲柟娉曟槸錛氱敤瀹炰綋&鏉ヨ〃紺恒?/pre>
<
<
灝忎簬鍙?/td>
>
>
澶т簬鍙?/td>
&
&
鍜?/td>
'
'
鍗曞紩鍙?/td>
"
"
鍙屽紩鍙?/td>
鍙︿竴縐嶈В鍐蟲柟娉曟槸浣跨敤CDATA閮ㄤ歡錛?/pre>
闇瑕佸湪鐢ㄦ埛鎶婂厜鏍囩Щ鍒版煇涓厓绱犱笂鏃舵樉紺轟竴浜涢澶栦俊鎭椂錛屾彁紺烘鏄竴縐嶄笉閿欑殑鏂瑰紡錛屾彁紺烘浼氬湪榧犳爣鍋滅暀鐨勬椂鍊欐樉紺猴紝榧犳爣縐誨紑鏃舵秷澶便?/p>
閫傚綋鐨勪嬌鐢ㄦ彁紺烘鑳藉ぇ澶ф彁鍗囩綉绔欑殑鍙嬪ソ搴︼紝騫朵笖鍙互鑺傜渷涓浜涗笉蹇呰鐨勭綉欏電┖闂達紝浠婂ぉ鎴戜滑灝嗙湅鍒?5嬈懼埗浣滃弸濂界殑鎻愮ず妗嗙殑jQuery鎻掍歡銆?/p>
qTip鏄竴嬈懼姛鑳介珮綰х殑鎻愮ず妗嗘彃浠訛紝瀹冩彁渚涗簡闈炲父澶氱殑鐗規(guī)э紝鍖呮嫭鍦嗚妗嗐佹彁紺烘場娉$瓑銆?br />
榪欎釜鎻愮ず妗嗘彃浠惰兘澶熸樉紺轟換浣曠殑HTML鍏冪礌錛屾瘮濡傞摼鎺ャ佽〃鏍箋佽〃鍗曘佸浘鐗囷紝瀹炵幇榪欎簺鏁堟灉鏄緢杞繪澗鐨勶紝浣犱篃鍙互杞繪澗鍒朵綔鍑鴻嚜宸辯嫭鐗歸鏍肩殑鎻愮ず妗嗐?img class="alignnone size-full wp-image-585" title="jquery-tools-tooltips" alt="jquery-tools-tooltips" src="http://www.webdesignbooth.com/wp-content/uploads/2009/06/jquery-tools-tooltips.png" width="500" height="132" />
Simpletip 鍏佽浣犻氳繃Jquery鐨勫厓绱犻夋嫨鍣ㄥ拰浜嬩歡綆$悊鍣ㄨ交鏉懼湪浠諱綍鍏冪礌涓婂埗浣滄彁紺烘錛屾彁紺烘鍙互浣塊潤鎬佺殑銆佸姩鎬佺殑銆佺敋鑷沖彲浠ラ氳繃ajax鍔犺澆錛屽茍涓旈兘鏈夐潪甯稿涓嶆噦鐨勬樉紺烘晥鏋溿?/p>
jQuery (mb)Tooltip鏄竴嬈鵑氳繃 jQuery timers 鍜屽崐閫忔槑闃村獎鎻掍歡瀹炵幇鐨勬紓浜殑鎻愮ず妗嗘彃浠訛紝瀹冧負鍚勭闇姹傛彁渚涘緢澶氬彲閫夐」銆?/p>
5. EZPZ Tooltip
浣犱笉闇瑕佹坊鍔犱換浣旵SS鎴栧浘鐗囧氨鍙互鎵╁睍銆佸畾鍒舵彁紺烘鐨勬牱寮忛鏍箋?/p>
榪欎釜鎻掍歡鍦ㄨ〃鍗曞彸杈規(guī)彁渚涗竴涓嚜鍔ㄥ彉鍖栫殑鎻愮ず妗嗭紝褰撹緭鍏ユ鑾峰緱鐒︾偣鏃跺畠?yōu)兗氭槃·哄Q屽け鍘葷劍鐐規(guī)椂灝遍殣钘忋?img class="alignnone size-full wp-image-588" title="iquery-input-floating-hint-box" alt="iquery-input-floating-hint-box" src="http://www.webdesignbooth.com/wp-content/uploads/2009/06/iquery-input-floating-hint-box.png" width="465" height="150" />
浣犲彲浠ョ敤 Orbital Tooltip鍦ㄧ洰鏍囧厓绱犵殑360°浠諱綍涓涓綅緗埗浣滃嚭涓涓彁紺烘銆?
Facebook椋庢牸鐨勬彁紺烘鎻掍歡銆?br />
div鐨勬牱寮忓涓嬶細
width:300px;
height:200px;
padding:10px;
border:10px solid #ccc;
background:#eee;
font-size:12px;
鍒欙細
IE6.0銆丗F1.06+錛?/strong>
clientWidth = width + padding = 300+10×2 = 320
clientHeight = height + padding = 200+10×2 = 220
offsetWidth = width + padding + border = 300+10×2+10×2= 340
offsetHeight = height + padding + border = 200+10×2+10×2 = 240
IE5.0/5.5錛?/strong>
clientWidth = width - border = 300-10×2 = 280
clientHeight = height - border = 200-10×2 = 180
offsetWidth = width = 300
offsetHeight = height = 200
杈規(guī)灞炴?font face="Times New Roman">(border)鐢ㄦ潵璁懼畾涓涓厓绱犵殑杈圭嚎銆?/font>
杈硅窛灞炴?font face="Times New Roman">(margin)鏄敤鏉ヨ緗竴涓厓绱犳墍鍗犵┖闂寸殑杈圭紭鍒扮浉閭誨厓绱犱箣闂寸殑璺濈銆?/font>
闂撮殭灞炴?font face="Times New Roman">(padding)鏄敤鏉ヨ緗厓绱犲唴瀹瑰埌鍏冪礌杈圭晫鐨勮窛紱匯?/font>
榪欎笁涓睘鎬ч兘灞炰簬CSS涓?/font>box綾誨瀷鐨勫睘鎬с?/font>
涓嬮潰榪欎釜紺烘剰鍥撅紝寰堝艦璞″湴浣撶幇浜嗕笁鑰呬箣闂寸殑鍖哄埆銆?/span>
榪欓噷鎻愪緵涓寮犵洅妯″瀷鐨?font face="Times New Roman">3D紺烘剰鍥撅紝甯屾湜渚夸簬浣犵殑鐞嗚В鍜岃蹇嗐?/font>
緗戦〉鍙鍖哄煙瀹斤細document.body.clientWidth
緗戦〉鍙鍖哄煙楂橈細document.body.clientHeight
緗戦〉鍙鍖哄煙瀹斤細document.body.offsetWidth (鍖呮嫭杈圭嚎鐨勫)
緗戦〉鍙鍖哄煙楂橈細document.body.offsetHeight (鍖呮嫭杈圭嚎鐨勫)
緗戦〉姝f枃鍏ㄦ枃瀹斤細document.body.scrollWidth
緗戦〉姝f枃鍏ㄦ枃楂橈細document.body.scrollHeight
緗戦〉琚嵎鍘葷殑楂橈細document.body.scrollTop
緗戦〉琚嵎鍘葷殑宸︼細document.body.scrollLeft
緗戦〉姝f枃閮ㄥ垎涓婏細window.screenTop
緗戦〉姝f枃閮ㄥ垎宸︼細window.screenLeft
灞忓箷鍒嗚鯨鐜囩殑楂橈細window.screen.height
灞忓箷鍒嗚鯨鐜囩殑瀹斤細window.screen.width
灞忓箷鍙敤宸ヤ綔鍖洪珮搴︼細window.screen.availHeight
灞忓箷鍙敤宸ヤ綔鍖哄搴︼細window.screen.availWidth
Header 1 | Header 2 | Header 3 | Header 4 | |||
---|---|---|---|---|---|---|
Cell Content 1 | Cell Content 2 | Cell Content 3 | Cell Content 4 | |||
More Cell Content 1 | More Cell Content 2 | More Cell Content 3 | More Cell Content 4 | |||
Even More Cell Content 1 | Even More Cell Content 2 | Even More Cell Content 3 | Even More Cell Content 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | And Repeat 4 | |||
And Repeat 1 | And Repeat 2 | And Repeat 3 | 鏈鍚?7 | |||
鍚堣: | 10000 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<style type="text/css">
<!--
body {
background: #FFF;
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
margin: 10px;
padding: 0
}
table, td, a {
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif
}
.td
{
nowrap:’’true’’;
}
div.tableContainer {
clear: both;
border: 1px solid #963;
height: 285px;
overflow: auto;
width: 100%;
}
/* WinIE 6.x needs to re-account for it’’s scrollbar. Give it some padding */
\html div.tableContainer/* */ {
padding: 0 16px 0 0
}
/* clean up for allowing display Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer {
height: auto;
padding: 0;
width: 740px
}
/* Reset overflow value to hidden for all non-IE browsers. */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer {
height: 285px;
overflow: hidden;
width: 756px
}
/* define width of table. IE browsers only */
/* if width is set to 100%, you can remove the width */
/* property from div.tableContainer and have the div scale */
div.tableContainer table {
float: left;
width: 100%
}
/* WinIE 6.x needs to re-account for padding. Give it a negative margin */
\html div.tableContainer table/* */ {
margin: 0 -16px 0 0
}
/* define width of table. Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer table {
float: none;
margin: 0;
width: 740px
}
/* define width of table. Add 16px to width for scrollbar. */
/* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer table {
width: 756px
}
/* set table header to a fixed position. WinIE 6.x only */
/* In WinIE 6.x, any element with a position property set to relative and is a child of */
/* an element that has an overflow property set, the relative value translates into fixed. */
/* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */
thead.fixedHeader tr {
position: relative;
/* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */
top: expression(document.getElementById("tableContainer").scrollTop)
}
thead.fixedHeader2 tr {
position: relative;
/* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */
bottom: expression(document.getElementById("tableContainer").scrollHeight > document.getElementById("tableContainer").clientHeight ? document.getElementById("tableContainer").scrollHeight - document.getElementById("tableContainer").scrollTop - document.getElementById("tableContainer").clientHeight :0)
}
/* set THEAD element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body thead[class].fixedHeader tr {
display: block
}
/* make the TH elements pretty */
thead.fixedHeader th {
background: #C96;
border-left: 1px solid #EB8;
border-right: 1px solid #B74;
border-top: 1px solid #EB8;
font-weight: normal;
padding: 4px 3px;
text-align: center
}
/* make the TH elements pretty */
thead.fixedHeader2 th {
background: #C96;
border-left: 1px solid #EB8;
border-right: 1px solid #B74;
border-top: 1px solid #EB8;
font-weight: normal;
padding: 4px 3px;
text-align: left
}
/* make the A elements pretty. makes for nice clickable headers */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 100%
}
thead.fixedHeader2 a, thead.fixedHeader2 a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 100%
}
/* make the A elements pretty. makes for nice clickable headers */
/* WARNING: swapping the background on hover may cause problems in WinIE 6.x */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 100%
}
/* define the table content to be scrollable */
/* set TBODY element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body tbody[class].scrollContent {
display: block;
height: 262px;
overflow: auto;
width: 100%
}
/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/ */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
background: #FFF;
border-bottom: 1px solid #EEE;
border-left: 1px solid #EEE;
border-right: 1px solid #AAA;
border-top: 1px solid #AAA;
padding: 2px 3px
}
tbody.scrollContent tr.alternateRow td {
background: #EEE;
border-bottom: 1px solid #EEE;
border-left: 1px solid #EEE;
border-right: 1px solid #AAA;
border-top: 1px solid #AAA;
padding: 2px 3px
}
/* define width of TH elements: 1st, 2nd, and 3rd respectively. */
/* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */
/* Add 16px to last TH for scrollbar padding */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
head:first-child+body thead[class].fixedHeader th {
width: 200px
}
head:first-child+body thead[class].fixedHeader th + th {
width: 250px
}
head:first-child+body thead[class].fixedHeader th + th + th {
border-right: none;
padding: 4px 4px 4px 3px;
width: 316px
}
/* define width of TH elements: 1st, 2nd, and 3rd respectively. */
/* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */
/* Add 16px to last TH for scrollbar padding */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
head:first-child+body tbody[class].scrollContent td {
width: 200px
}
head:first-child+body tbody[class].scrollContent td + td {
width: 250px
}
head:first-child+body tbody[class].scrollContent td + td + td {
border-right: none;
padding: 2px 4px 2px 3px;
width: 300px
/* expression is for WinIE 5.x only. Remove to validate and for pure CSS solution */
top: expression(document.getElementById("tableContainer").scrollTop)
}
-->
</style>
</head><body>
<script>
function test() {
var cH = document.getElementById("tableContainer").clientHeight;
var sH = document.getElementById("tableContainer").scrollHeight;
var sT = document.getElementById("tableContainer").scrollTop;
alert(cH+":"+sH+":"+sT);
}
</script>
<div id="tableContainer" class="tableContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="scrollTable">
<thead class="fixedHeader">
<tr>
<th><a href="#" onclick="javascript:test();">Header 1</a></th>
<th><a href="#">Header 2</a></th>
<th><a href="#">Header 3</a></th>
<th><a href="#">Header 4</a></th>
</tr>
</thead>
<tbody class="scrollContent">
<tr>
<td>Cell Content 1</td>
<td>Cell Content 2</td>
<td>Cell Content 3</td>
<td>Cell Content 4</td>
</tr>
<tr>
<td>More Cell Content 1</td>
<td>More Cell Content 2</td>
<td>More Cell Content 3</td>
<td>More Cell Content 4</td>
</tr>
<tr>
<td nowrap>Even More Cell Content 1</td>
<td nowrap>Even More Cell Content 2</td>
<td nowrap>Even More Cell Content 3</td>
<td nowrap>Even More Cell Content 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>And Repeat 4</td>
</tr>
<tr>
<td>And Repeat 1</td>
<td>And Repeat 2</td>
<td>And Repeat 3</td>
<td>鏈鍚?7</td>
</tr>
</tbody>
<thead class="fixedHeader2">
<tr>
<th><a href="#">鍚堣:</a></th>
<th colspan=6><a href="#">10000</a></th>
</tr>
</thead>
</table>
</div>
</body></html>
iframeObj.id = thisObj.name+"_suggest_iframe";
iframeObj.name = thisObj.name+"_suggest_iframe";
document.body.appendChild(iframeObj);
if (isNull(divObj)) {
divObj = document.createElement("DIV");
}
divObj.name = thisObj.name+"_suggest";
divObj.id = thisObj.name+"_suggest";
divObj.style.border = '1px';
divObj.isOut = "true";
divObj.onmouseover = "javascript:this.isOut = 'false'";
divObj.onmouseout = "javascript:this.isOut = 'true'";
divObj.style.cursor = "hand";
document.body.appendChild(divObj);
divObj.style.position = "absolute";
ajax.setResponseFun(function(){
var dom = ajax.getDomDoc();
if(dom.readyState == 4) {
var root = dom.documentElement;
var str = "";
if (root.childNodes.length == 0) {
document.body.onclick();
return true;
}
for(var i = 0; i < root.childNodes.length; i++) {
str+="<div onmouseover='javascript:suggestOver(this);'";
str+=" onmouseout='javascript:suggestOut(this);' ";
str+=" onclick='javascript:setSearch(this.innerHTML,\""+thisObj.name+"\");' class='td-across-low' style='background-color:white;'>";
str+=root.childNodes[i].text+"</div>";
}
divObj.innerHTML = str;
divObj.style.borderBottom = '0.008cm outset ';
divObj.style.borderRight = '0.008cm outset ';
divObj.style.borderTop = '0.008cm outset ';
divObj.style.borderLeft = '0.008cm outset ';
divObj.style.overflowY = "auto";
divObj.style.height = divObj.offsetHeight > 300 ? 300 : divObj.offsetHeight;
var oRect = thisObj.getBoundingClientRect();
divObj.style.left = oRect.left;
divObj.style.top = oRect.top + 18;
divObj.style.width = thisObj.clientWidth+2;
try {
var iobj = document.getElementById(thisObj.name+"_suggest_iframe");
iobj.style.position = "absolute";
iobj.style.left = divObj.offsetLeft;
iobj.style.top = divObj.offsetTop;
iobj.style.height = divObj.offsetHeight;
iobj.style.width = divObj.offsetWidth;
} catch(e){}
}
});
ajax.send();
return true;
}
function suggestOver(obj) {
for(var i = 0; i < obj.parentNode.childNodes.length; i++) {
obj.parentNode.childNodes[i].className = "td-across-low";
obj.parentNode.childNodes[i].style.backgroundColor = "white";
}
obj.className = "td-across-deep";
obj.style.backgroundColor = "";
}
function suggestOut(obj) {
obj.className = "td-across-low";
obj.style.backgroundColor = "white";
}
function setSearch(value,thisObjName) {
document.all[thisObjName].value = value;
try {
document.body.removeChild(document.getElementById(thisObjName+"_suggest_iframe"));
document.body.removeChild(document.getElementById(thisObjName+"_suggest"));
} catch (e){}
}
function hideSuggest(thisObj) {
var obj = document.getElementById(thisObj.name+"_suggest");
if ( isNull(obj) ) {
return true;
} else {
if (obj.isOut == "true") {
document.body.removeChild(document.getElementById(obj.name+"_suggest_iframe"));
document.body.removeChild(obj);
}
}
return true;
}
var menuOpen = false;
function openMemo(){
var obj = document.getElementById('frameaaa');
if(!menuOpen) {
obj.src = "XXX/XXX.html";
obj.style.display="block";
menuOpen = true;
try {
obj.onreadystatechange = function() {obj.fireEvent('onload');}
} catch(e) {}
}
}
濡傛灉娌℃湁onreadystatechange錛屽皬鏂囦歡鏄傚悎鐨勶紝澶ф枃浠跺氨涓嶈浜?/p>
/**
* CMsnMsg瀵硅薄鐨勬樉紺烘柟娉?br>*/
CMsnMsg.prototype.show = function() {
var pop = window.createPopup();
this.pop = pop;
var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: "
str +=this.width + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + this.height + "px; BACKGROUND-COLOR: #c9d3f3'>"
str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0>"
str += "<TR>"
str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>"
str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' vAlign=center width='100%'>" + this.title + "</TD>"
str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=19>"
str += "<SPAN title=鍏抽棴 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: black; MARGIN-RIGHT: 4px' id='btSysClose' >×</SPAN></TD>"
str += "</TR>"
str += "<TR>"
str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (this.height-28) + ">"
str += "<DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px;";
str += "BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>"
str += this.innerHTML;
str += "</DIV>"
str += "</TD>"
str += "</TR>"
str += "</TABLE>"
str += "</DIV>"
pop.document.body.innerHTML = str;
this.offset = 0;
var me = this;
pop.document.body.onmouseover = function() {me.pause = true;};
pop.document.body.onmouseout = function() {me.pause = false;};
var fun = function() {
var x = me.left;
var y = 0;
var width = me.width;
var height = me.height;
if (me.offset > me.height) {
height = me.height;
} else {
height = me.offset;
}
y = me.bottom - me.offset;
if (y <= me.top) {
me.timeout -= 1;
if (me.timeout == 0) {
window.clearInterval(me.timer);
if (me.autoHide) {
me.hide();
}
}
} else {
me.offset += me.step;
}
me.pop.show(x,y,width,height);
}
this.timer = window.setInterval(fun,this.speed);
var btClose = pop.document.getElementById("btSysClose");
btClose.onclick = function(){
me.close = true;
me.hide();
}
}
/**
* CMsnMsg瀵硅薄鐨勫叧闂柟娉?br>*/
CMsnMsg.prototype.hide = function() {
flag = true;
var offset = this.height>this.bottom-this.top?this.height:this.bottom-this.top;
var me = this;
if(this.timer > 0){
window.clearInterval(me.timer);
}
var fun = function() {
if (!me.pause || me.close) {
var x = me.left;
var y = 0;
var width = me.width;
var height = 0;
if (me.offset > 0) {
height = me.offset;
}
y = me.bottom - height;
if (y >= me.bottom) {
window.clearInterval(me.timer);
me.pop.hide();
} else {
me.offset -= me.step;
}
me.pop.show(x,y,width,height);
}
}
this.timer = window.setInterval(fun,this.speed);
}
var msg = null;
function test() {
if (msg == null || !msg.pause) {
msg = new CMsnMsg(300,220,"ABM緋葷粺鎻愮ず");
msg.innerHTML = "<A href='www.baidu.com'>www.baidu.com</a>"
msg.show();
}
}
window.setInterval("test();",20000);