Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript ͼƬԤÀÀЧ¹û

Ëæ×Åä¯ÀÀÆ÷°²È«ÐÔµÄÌá¸ß£¬ÒªÊµÏÖͼƬԤÀÀÒ²Ô½À´Ô½À§ÄÑ¡£
²»¹ýȺÖÚµÄÖÇ»ÛÊÇÎÞÏ޵ģ¬ÍøÉÏÒ²Óкܶà±äͨ»òÏȽøµÄ·½·¨À´ÊµÏÖ¡£
ÔÚÑо¿Á˸÷ÖÖÔ¤ÀÀ·½·¨ºó£¬×÷Ϊ×ܽᣬдÁËÕâ¸ö³ÌÐò£¬¸ú´ó¼ÒÒ»Æð·ÖÏí¡£
ÉÏ´ÎдµÄ¼ò±ãÎÞË¢ÐÂÎļþÉÏ´«ÏµÍ³×î³õµÄÄ¿µÄ¾ÍÊÇÓÃÀ´ÊµÏÖÕâ¸öͼƬԤÀÀЧ¹û¡£
¼æÈÝ£ºie6/7/8, firefox 3.5.5
ºǫ֧́³ÖÏ»¹¼æÈÝ£ºopera 10.10, safari 4.0.4, chrome 3.0
ps£º¼æÈÝopera, safariºÍchromeÐèÒªºǫ֧́³Ö£¬ÇëÏÂÔØʵÀý²âÊÔ¡£
³ÌÐò˵Ã÷
¡¾»ù±¾Ô­Àí¡¿
ͼƬԤÀÀÖ÷Òª°üÀ¨Á½¸ö²¿·Ö£º´Ófile±íµ¥¿Ø¼þ»ñȡͼÏñÊý¾Ý£¬¸ù¾ÝÊý¾ÝÏÔʾԤÀÀͼÏñ¡£
³ÌÐòµÄfileºÍimgÊôÐÔ¾ÍÊÇÓÃÀ´±£´æfile¿Ø¼þºÍÏÔʾԤÀÀͼÏñµÄÈÝÆ÷µÄ£¬¶øimg»¹±ØÐëÊÇimgÔªËØ¡£
³ÌÐòÓÐÒÔϼ¸ÖÖÔ¤ÀÀ·½Ê½£º
simpleģʽ£ºÖ±½Ó´ÓfileµÄvalue»ñȡͼƬ·¾¶À´ÏÔʾԤÀÀ£¬ÊÊÓÃÓÚie6£»
filterģʽ£ºÍ¨¹ýselection»ñÈ¡fileµÄͼƬ·¾¶£¬ÔÙÓÃÂ˾µÀ´ÏÔʾԤÀÀ£¬ÊÊÓÃÓÚie7/8£»
domfileģʽ£ºµ÷ÓÃfileµÄgetAsDataURL·½·¨»ñÈ¡Data URIÊý¾ÝÀ´ÏÔʾԤÀÀ£¬ÊÊÓÃÓÚff3£»
remoteģʽ£º×îºóµÄ°ì·¨£¬°ÑfileÌá½»ºǫ́´¦Àíºó·µ»ØͼƬÊý¾ÝÀ´ÏÔʾԤÀÀ£¬È«ÊÊÓá£
³ÌÐò¶¨Òåʱ¾Í×Ô¶¯¸ù¾Ýä¯ÀÀÆ÷ÉèÖÃMODEÊôÐÔ£º
ImagePreview.MODE = $$B.ie7 || $$B.ie8 ? "filter" :
    $$B.firefox ? "domfile" :
    $$B.opera || $$B.chrome || $$B.safari ? "remote" : "simple";
Èç¹ûÓÃÄÜÁ¦¼ì²â»á±È½ÏÂé·³£¬ËùÒÔÖ»ÓÃÁËä¯ÀÀÆ÷¼ì²â¡£
ÓÉÓÚä¯ÀÀÆ÷¶ÔÓ¦µÄĬÈÏģʽÊDz»»á±äµÄ£¬Õâ¸öÖµ»á±£´æµ½º¯ÊýÊôÐÔÖÐ×÷Ϊ¹«ÓÃÊôÐÔ¡£
ps£ºie6Ò²¿ÉÒÔÓÃfilterģʽ£¬²»¹ýËüÓиüºÃµÄsimpleģʽ¡£
¡¾»ñÈ¡Êý¾Ý¡¿
µ÷ÓÃpreview·½·¨£¬¾Í»áÖ´ÐÐÔ¤ÀÀ³ÌÐò£º
if ( this.file && false !== this.onCheck() ) {
    this._preview( this._getData() );
}
 
ÔÚͨ¹ý¼ì²âºó£¬ÔÙµ÷ÓÃ_getData»ñÈ¡Êý¾Ý£¬²¢×÷Ϊ_previewµÄ²ÎÊý½øÈëÏÂÒ»²½¡£
³ÌÐò³õʼ»¯Ê±¾Í»á¸ù¾ÝmodeÀ´ÉèÖÃ_getDataÊý¾Ý»ñÈ¡³ÌÐò£º
this._getData = this._getDataFun(opt.mode);
modeµÄĬÈÏÖµÊÇImagePreview.MODE£¬Ò²¿ÉÒÔÔÚ¿ÉÑ¡²ÎÊýÖÐ×Ô¶¨Òå¡£
ÓÉÓÚ¼æÈÝÐÔÎÊÌ⣬һ°ãÓ¦±£ÁôĬÈÏÖµ£¬³ý·ÇÊÇʹÓÃÈ«¼æÈݵÄremoteģʽ¡£
ÔÚ_getDataFunÀïÃ棬¸ù¾Ýmode·µ»ØÊý¾Ý»ñÈ¡³


Ïà¹ØÎĵµ£º

JavascriptÖÐ×î³£ÓõÄ61¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......

Javascript ¼¼Çɼ¯ºÏ(ºÜºÃ)

   
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture(); 
event.srcElement.releaseCapture(); 
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
eve ......

JavaScript ²Ù×÷ select

Ò»¡¢ÐÂÔöÒ»¸öoption
var sel=document.getElementById("selectµÄid");
var op=document.createElement("option");
op.value=Öµ;
op.text=ÏÔʾÎı¾;
sel.add(op);
¶þ¡¢É¾³ýÒ»¸öoption
var sel=document.getElementById("typelist");
if(sel.selectedIndex==-1)
alert("ÇëÑ¡ ......

JavaScriptºËÐIJο¼½Ì³Ì ÄÚÖöÔÏó

JavaScript ÊǸù¾Ý "ECMAScript"±ê×¼Öƶ¨µÄÍøÒ³½Å±¾ÓïÑÔ¡£Õâ¸ö±ê×¼ÓÉ ECMA ×éÖ¯·¢Õ¹ºÍά»¤¡£ECMA-262
ÊÇÕýʽµÄ JavaScript ±ê×¼¡£Õâ¸ö±ê×¼»ùÓÚ JavaScript (Netscape) ºÍ JScript
(Microsoft)¡£Netscape (Navigator 2.0) µÄ Brendan Eich ·¢Ã÷ÁËÕâÃÅÓïÑÔ£¬´Ó 1996
Ä꿪ʼ£¬ÒѾ­³öÏÖÔÚËùÓÐµÄ Netscape ºÍ Micro ......

JavaScriptµÄ·½·¨ºÍ¼¼ÇÉ

JavaScriptµÄ·½·¨ºÍ¼¼ÇÉ ÊÕ²Ø
ÓÐЩʱºòÄ㾫ͨһÃÅÓïÑÔ£¬µ«ÊǻᷢÏÖÄãÆäʵÕûÌìÔÚºÍÆäËüÓïÑÔ´ò½»µÀ£¬Ò²ÐíÄãÒÔΪÕâЩ΢²»×ãµÀ£¬²»ÖÁÓÚÓ°ÏìÄãµÄ¿ª·¢½ø¶È£¬µ«Ç¡Ç¡ÊÇÕâЩÄã²»ÖØÊӵĶ«Î÷»áÀË·Ñ ÄãºÜ¶àʱ¼ä£¬ÎÒÒ»Ö±ÒÔΪÎÒÔçÔÚ¼¸ÄêÇ°¾ÍÒѾ­¾«Í¨JavaScriptÁË£¬Ö±µ½Ä¿Ç°£¬ÎÒ²ÅÔ½À´Ô½¾õµÃJavaScriptÔ¶±ÈÎÒÏëÏóµÄ¸´ÔÓºÍÇ¿´ó£¬ÎÒ¿ªÊ¼³ç ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ