NotesForLightBox 鏄竴涓畝鍗曟槗鐢ㄧ殑鑴氭湰锛岀敤浜庡湪褰撳墠椤甸潰鏀惧ぇ鍘熷浘銆?/p>
褰撳墠鐨勫姛鑳界壒寰佹湁锛?/p>
- 鍦嗚鐏
- 鎸夐挳瀵艰埅
- 甯︽湁杩涘害鏉$殑骞荤伅鏄剧ず
涓嬮潰浠嬬粛涓€涓嬪浣曚娇鐢細
- 涓嬭浇NotesForLightBox
NotesForLightBox涓嬭浇鍦板潃 - 鍦ㄩ渶瑕佺伅绠辩壒鏁堢殑椤甸潰娣诲姞寮曠敤鐨凧avaScript鍜孋SS鑴氭湰
鍥犱负NotesForLightBox渚濊禆浜巎Query搴擄紝鎵€浠ヤ篃璁歌瀵煎叆jQuery搴撱€?/p><script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/NFLightBox.js" type="text/javascript"></script> <link href="css/nf.lightbox.css" rel="stylesheet" type="text/css" media="screen" />
- 澹版槑瀵归〉闈腑閭d簺鍏冪礌寮€鍚伅绠辩壒鏁?pre><script type="text/javascript"> $(function() { $('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel $('#gallery a').lightBox(); // Select all links in object with gallery ID $('a.lightbox').lightBox(); // Select all links with lightbox class $('a').lightBox(); // Select all links in the page }); </script>
涓嬮潰鏄垜鐨勭ず渚嬫枃浠?demo.html)鎴浘
鍚庤锛?/p>
鐢ㄦ埛鍙互鑷畾涔塋ightBox鎺т欢鐨勬樉绀烘牸寮忋€傚彲鐢ㄧ殑灞炴€ф湁
///聽聽聽 <param name="settings" type="Options"> ///聽聽聽聽聽聽聽 1: overlayBgColor - (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. ///聽聽聽聽聽聽聽 2: overlayOpacity - (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9. ///聽聽聽聽聽聽聽 3: fixedNavigation - (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. ///聽聽聽聽聽聽聽 4: imageLoading - (string) Path and the name of the loading icon image ///聽聽聽聽聽聽聽 5: imageBtnPrev - (string) Path and the name of the prev button image ///聽聽聽聽聽聽聽 6: imageBtnNext - (string) Path and the name of the next button image ///聽聽聽聽聽聽聽 7: imageBtnClose - (string) Path and the name of the close button image ///聽聽聽聽聽聽聽 8: imageBlank - (string) Path and the name of a blank image (one pixel) ///聽聽聽聽聽聽聽 9: imageBtnBottomPrev - (string) Path and the name of the bottom prev button image ///聽聽聽聽聽聽聽 10: imageBtnBottomNext - (string) (string) Path and the name of the bottom next button image ///聽聽聽聽聽聽聽 11: imageBtnPlay - (string) Path and the name of the close button image ///聽聽聽聽聽聽聽 12: imageBtnStop - (string) Path and the name of the play button image ///聽聽聽聽聽聽聽 13: containerBorderSize - (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value ///聽聽聽聽聽聽聽 14: containerResizeSpeed - (integer) Specify the resize duration of container image. These number are miliseconds. 500 is default. ///聽聽聽聽聽聽聽 15: txtImage - (string) Specify text "Image" ///聽聽聽聽聽聽聽 16: txtOf - (string) Specify text "of" ///聽聽聽聽聽聽聽 17: txtPrev - (string) Specify text "previous" ///聽聽聽聽聽聽聽 18: keyToNext - (string) Specify text "next" ///聽聽聽聽聽聽聽 19: keyToClose - (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. ///聽聽聽聽聽聽聽 20: keyToPrev - (string) (p = previous) Letter to show the previous image. ///聽聽聽聽聽聽聽 21: keyToNext - (string) (n = next) Letter to show the next image. ///聽聽聽聽聽聽聽 22: slideShowTimer - (integer) number of milliseconds to change image by default 5000. ///聽聽聽 </param>
渚嬪璋冩暣鐏鎷夐暱鏃堕棿
<script type="text/javascript"> $(function(){ var settings = {containerResizeSpeed:350}; $('a').lightBox(settings); }); </script>
澶х害2澶╁墠 -
Lightbox 鎸囩伅绠辩壒鏁堬紝鏄垜浠湪澶勭悊鍥剧墖娴忚鏃跺父鐢ㄧ殑鎶€宸с€備笅闈粙缁嶄互涓?2绉嶅父瑙佺殑lightbox鐏鏁堟灉鑴氭湰銆?/p>
1. Multibox (婕旂ず鍦板潃)
涓€涓猯ightbox鏀寔鐨勫唴瀹规牸寮忓寘鎷細鍥剧墖锛孎lash锛岃棰戯紝mp3锛宧tml銆?br /> 2. YUI Based Lightbox ()
浣跨敤YUI Dialog class寮€鍙戠殑lightbox鎺т欢銆?br /> 3. weebbox
weebbox 鏄竴涓熀浜嶱rototype Scriptaculous锛?72k锛?寮€鍙戯紝浠縇ightbox鏁堟灉鐢ㄤ簬灞曠ず鍥剧墖鐨刯avascript鎺т欢銆?br /> 4. Pirobox (婕旂ず鍦板潃)
閲囩敤jquery寮€鍙戠殑Lightbox鎺т欢銆傝兘澶熸牴鎹祻瑙堝櫒绐椾綋澶у皬鑷姩璋冩暣灞曠ず鍥剧墖澶у皬銆傛彁渚涘悜鍓?鍚戝悗鎺у埗閾炬帴銆傚姩鎬佸姞杞藉浘鐗囨晥鏋溿€傛槗浜庡畾鍒躲€?br /> 5. QuickBox
QuickBox鏄竴涓熀浜嶮ootools1.2鐗堟湰寮€鍙戠殑Lightbox鎺т欢銆備笌鍏跺畠Lightbox鎺т欢鐩告瘮锛屽畠鏈€澶т笉鍚屼箣澶勫湪浜庡彲浠ュ埄鐢ㄩ紶鏍囨粴杞帶鍒跺浘鐗囧垏鎹€?br /> 6. Zoomy.js
Zoomy.js 鏄竴涓噰鐢≒rototype妗嗘灦寮€鍙戯紝鎷ユ湁鍥剧墖鏀惧ぇ鍔熻兘鐨刬mage gallery銆傚湪鏀剧疆鏀惧ぇ鍥剧墖鐨勫脊鍑鸿鐩栨涓彲浠ヨ缃爣棰樹笌鍏抽棴鎸夌航锛屽苟涓斿彲浠ユ嫋鍔ㄥ脊鍑烘銆?br /> 7. BackBox
BackBox鏄竴涓敮鎸佽嚜鍔ㄤ笌鎵嬪姩涓ょ鍥剧墖灞曠ず妯″紡鐨凩ightbox鎺т欢銆?br /> 8. jQuery Superbox!
jQuery Superbox!鏄竴涓猨Query鎻掍欢鐢ㄤ簬鍒涘缓鍙畾鍒剁殑妯″紡瀵硅瘽妗嗭紙鏁堟灉涓巐ightbox鐩镐技锛夈€傚畠鍙互灞曠ず浠绘剰绫诲瀷鐨勫唴瀹瑰寘鎷琲frames锛岄粯 璁や负鍥剧墖绫诲瀷锛堟敮鎸佸崟寮犳垨澶氬紶妯″紡锛夈€傛ā寮忓璇濇鐨勫昂瀵稿彲浠ユ牴鎹睍绀虹殑鍐呭鑷姩璋冩暣锛屼篃鍙互瀹氫箟涓€涓爣鍑嗗睍绀哄昂瀵搞€?br /> 9. Bumpbox (婕旂ず鍦板潃)
Bumpbox 鏄竴涓熀浜嶮ootools寮€鍙戠殑Lightbox鎺т欢銆傚畠鍙互鑷姩鎺㈡祴瑕佸睍绀虹殑鍐呭绫诲瀷锛屼笉闇€瑕侀鍏堟寚瀹氥€?Bumpbox闄や簡鍙互灞曠ずFLV銆丼WF銆佸浘鐗囧拰HTML鍐呭涔嬪锛岃繕鍙互灞曠ずPDF鏂囦欢銆?br /> 10. NotesForLightBox (婕旂ず鍦板潃)
NotesForLightBox 鏄竴涓噰鐢?jQuery 寮€鍙戠殑LightBox 鎺т欢锛屾敮鎸佸ぇ閮ㄥ垎娴忚鍣ㄣ€傛彁渚涘鑸挱鏀炬寜閽紝鍥剧墖鍔犺浇杩涘害鎻愰啋銆傘€傛ā寮忓璇濇閲囩敤鍦嗚椋庢牸銆?br /> 11. FacyBox
FacyBox 鏄竴涓熀浜?jQuery 瀹炵幇锛孎acebook/Fancybox 椋庢牸鐨?lightbox 鎺т欢銆傚彲浠ュ睍绀哄浘鐗囥€丏iv鎴栭€氳繃ajax鍔犺浇鐨勫唴瀹广€?br /> 12. LeaveNotice (婕旂ず鍦板潃)
LeaveNotice 杩欎釜 jQuery 鎻掍欢鑳藉寰堟柟渚挎彁閱掍綘鐨勭敤鎴凤紝浠栦滑姝e湪绂诲紑浣犵殑缃戠珯銆?/p>
澶х害1鏈堝墠 -
浠ュ墠璋冭瘯 javascript 鎬绘槸鐥涜嫤涓嶅牚鐨勪娇鐢ㄤ竴涓張涓€涓殑 alert. 涓嶈繃鐜板湪閫氳繃浣跨敤 firefox 鐨?firibug 鐨勬彃浠讹紝缁堜簬鎽嗚劚浜嗗彲鎭剁殑 alert .
Firebug鏄竴涓潪甯稿ソ鐢ㄧ殑璋冭瘯宸ュ叿锛屽畠鍙互闄ら敊銆佺紪杈戙€佺敋鑷冲垹鏀逛换浣曠綉绔欑殑 CSS銆丠TML銆丏OM銆佷笌 JavaScript 浠g爜锛屽綋鐒跺ajax涔熷崄鍒嗗ソ鐢ㄣ€傚叾涓渶涓昏鐨凜onsole鏄疐irebug缁欏嚭鍚勭淇℃伅鐨勭獥鍙o紝鑰岃繖涔熸鏄疌onsole鐨勪富瑕佺敤閫斻€傞櫎姝や箣澶栵紝Console杩樻彁渚涗簡閫氳繃鍛戒护琛屾柟寮忔潵璋冭瘯Javascript鐨勫绉嶆柟娉曘€?/p>
console.debug(object[, object, ...])
鍦ㄦ帶鍒跺彴杈撳嚭涓€鏉℃秷鎭?鍖呭惈涓€涓寚鍚戜唬鐮佽皟鐢ㄤ綅缃殑瓒呴摼鎺?鍋囧鏄洿鎺ュ湪鎺у埗鍙拌緭鍏ヨ鍛戒护,灏变笉浼氬嚭鐜拌秴閾炬帴(鍜宑onsole.log()涓€聽 鏍?.
console.info(object[, object, ...])
鍦ㄦ帶鍒跺彴杈撳嚭涓€鏉″甫鏈夆€滀俊鎭€濆浘鏍囩殑娑堟伅鍜屼竴涓寚鍚戜唬鐮佽皟鐢ㄤ綅缃殑瓒呴摼鎺?
console.warn(object[, object, ...])
鍦ㄦ帶鍒跺彴杈撳嚭涓€鏉″甫鏈夆€滆鍛娾€濆浘鏍囩殑娑堟伅鍜屼竴涓寚鍚戜唬鐮佽皟鐢ㄤ綅缃殑瓒呴摼鎺?
console.error(object[, object, ...])
鍦ㄦ帶鍒跺彴杈撳嚭涓€鏉″甫鏈夆€滈敊璇€濆浘鏍囩殑娑堟伅鍜屼竴涓寚鍚戜唬鐮佽皟鐢ㄤ綅缃殑瓒呴摼鎺?
console.assert(expression[, object, ...])
娴嬭瘯琛ㄨ揪寮廵xpression鏄惁涓虹湡.濡傛灉涓嶆槸鐪?浼氬湪鎺у埗鍙板啓涓€鏉℃秷鎭苟鎶涘嚭寮傚父
console.dir(object)
浠ュ垪琛ㄥ舰寮忚緭鍑轰竴涓璞$殑鎵€鏈夊睘鎬?鏈夌偣鍜屾煡鐪婦OM绐楀彛鐩哥被浼?
console.dirxml(node)
杈撳嚭涓€涓狧TML鎴栬€匵ML鍏冪礌鐨刋ML婧愪唬鐮?鍜屽湪HTML绐楀彛鐪嬪埌鐨勭浉浼?
console.group(object[, object, ...])
杈撳嚭涓€鏉℃秷鎭?骞舵墦寮€涓€涓祵濂楀潡,鍧椾腑鐨勫唴瀹归兘浼氱缉杩?璋冪敤console.groupEnd()鍏抽棴鍧?璇ュ懡浠ゅ彲浠ュ祵濂椾娇鐢?
console.groupEnd()
鍏抽棴鏈€杩戜竴涓敱console.group鎵撳紑鐨勫潡.
console.time(name)
鍒涘缓涓€涓悕瀛椾负name鐨勮鏃跺櫒,璋冪敤console.timeEnd(name)鍋滄璁℃椂鍣ㄥ苟杈撳嚭鎵€鑰楁椂闂?姣).
console.timeEnd(name)
鍋滄鍚屽悕鐨勮鏃跺櫒骞惰緭鍑烘墍鑰楁椂闂?姣).
console.profile([title])
鎵撳紑Javascript鎬ц兘娴嬭瘯寮€鍏?鍙€夊弬鏁皌itle浼氬湪鎵撳嵃鎬ц兘娴嬭瘯鎶ュ憡鏃跺湪鎶ュ憡鐨勫紑澶磋緭鍑?
console.profileEnd()
鍏抽棴Javascript鎬ц兘娴嬭瘯寮€鍏冲苟杈撳嚭鎶ュ憡.
console.clear()
娓呯┖console淇℃伅绐楀彛.
鍙﹀锛孎irebug杩樺彲浠ヨ缃柇鐐广€傚崟鍑昏鍙凤紝灏变細璁剧疆涓€涓柇鐐广€傚彸鍑昏鍙凤紝灏卞彲浠ヨ缃竴涓柇鐐瑰嚭鐜扮殑鏉′欢锛屽彧鏈夊綋鏉′欢涓虹湡鏃讹紝绋嬪簭鎵嶄細鏆傚仠鎵ц銆傚彸闈㈣繕鏈変竴涓獁atch绐楀彛锛屽彲浠ョ洃鎺у綋鍓嶇殑鍙橀噺锛屼篃鍙互鏌ョ湅璁剧疆鐨勬柇鐐广€?/p>
澶х害3鏈堝墠 -
jQuery 鐨勮法鍩熻皟鐢ㄥ疄闄呬笂娌℃湁閭d箞澶嶆潅锛屽彧瑕佹槑鐧藉嚑涓蹇碉紝鏈変竴瀹氱殑 JavaScript 鍩虹鍗冲彲銆?br /> 棣栧厛瑕佷簡瑙?jQuery.getJSON 鍑芥暟
jQuery.getJSON(聽url,聽[data],聽[callback] )
===============================================
[1] As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback.
[2] The callback takes the form “example.com?callback=?”. [3] jQuery automatically replaces the ‘?’ with a random method name that doesn’t clash with the global scope. You do not have