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

javascript ÔØÈëͼƬºóÖ´ÐÐij²Ù×÷

function EnhancedImage(src,onLoaded){
var self = this;
this.src = src;
this.width = 0;
this.height = 0;
this.onLoaded = onLoaded;
this.loaded = false;
this.image = null;

this.load = function(){
if(this.loaded)
return;
this.image = new Image();
this.image.src = this.src;
function loadImage(){
if(self.width != 0 && self.height != 0){
clearInterval(interval);
self.loaded = true;
self.onLoaded(self);//½«ÊµÀý´«Èë»Øµ÷º¯Êý
}
self.width = self.image.width;//ÊÇnumberÀàÐÍ
self.height = self.image.height;
}
var interval = setInterval(loadImage,100);
}
}
function onImageLoad(image){
document.getElementById('banner').appendChild(image.image);
}
var img = new EnhancedImage("somthing.jpg",onImageLoad);
img.load();

newÒ»¸öImage¶ÔÏó£¬ÉèÖÃÁËsrcÊôÐÔ¹ýºó£¬²»¶ÏµÄ¼ì²éÐèÒªÔØÈëµÄͼƬµÄ¿íºÍ¸ß£¬Èç¹ûÔØÈëͼƬ³É¹¦µÄ»°£¬¿íºÍ¸ß¶¼ÊDz»Îª0µÄÊýÖµ£¬Õâ¸öʱºòÍ£Ö¹Interval £¬²¢ÇÒÖ´ÐÐonLoaded¡£


Ïà¹ØÎĵµ£º

ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ


ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ
 
ugmbbc·¢²¼ÓÚ 2010-04-24 10:15:58|10771 ´ÎÔĶÁ ×ÖÌ壺´ó Ð¡ ´òÓ¡Ô¤ÀÀ      
¸ÐлÈñÉÌÆóÒµCMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:Smashing Magazine
JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ ......

JavaScript°æ Ö²Îï´óÕ½½©Ê¬


ÔÚÏßÊÔÍ棺http://asfoxes.w229.7ga.net/js
ÏÂÔصØÖ·£ºhttp://download.csdn.net/source/2235386
֮ǰ»¨ÁËÒ»¸ö½üÒ»¸öÀñ°ÝдµÄ
Ä¿Ç°»ù±¾Íê³ÉÁË£¬¿ÉÒÔÈ¥³¢ÊÔÏÂ
ä¯ÀÀÆ÷°æ±¾£º
IE8Õý³£ÔËÐÐ
op¡¢ff...ÉÐÓÐÒ»¸öСbug£¬²»ÄÜÍêÃÀÔËÐÐ
Ö÷ÒªÓÐÒÔϼ¸¸öÎÊÌâÔÝʱû´¦Àí£º
1.¸ü¼Ó¶àµÄÖ²ÎïºÍ½©Ê¬ÖÖÀàÌí¼Ó
2.Ö²ÎïºÍ½©Ê¬µÄÌùͼ»¹ ......

ÖØÊ°JavaScriptż¸Ð

    ¼ÇµÃ´óÒ»µÄʱºò£¬ÎÒÃÇרҵ¿ªÁËÍøÒ³Éè¼ÆÕâÃſγ̣¬ÄÇʱ£¬¿´×ÅÊéÉϵļòµ¥¼¸ÐдúÂë²úÉúµÄJSÌØЧ£¬ºÜÕ𾪣¬¾Íϲ»¶ÉÏÁËjs½Å±¾ÓïÑÔ£¬ºÃËÆÈËÃdz£ËµµÄÒ»¼ûÖÓÇé°É¡£¾ªÑÞÓÚËýÇ¿´óµÄ¹¦ÄÜ¡£¿ÉÊÇ£¬¶ÔÓÚ£ê£ó,Ö»ÄÜÓÃÒź¶À´ÐÎÈݵ±Ê±ÎÒµÄÐÄÇé¡£µ±Ê±£¬ÀÏʦֻÊÇΪ¸Ï½ø¶È£¬Íê³ÉËùνµÄѧԺ²¼ÖõĽÌѧÈÎÎñ£¬×øÔÚ¶àýÌåµçÄÔÇ°£¬ ......

JavaScript ²âÊÔ¼°Ð£Ñ鹤¾ß

JavaScript ÊÇÒ»¿îÇ¿´óµÄ¹ã·ºÔËÓÃÓÚÏÖ´úWebÕ¾µã¼°Ó¦ÓõĽű¾ÓïÑÔ¡£×÷Ϊһ¸ö¼¼ÒÕ¾«Õ¿µÄ Web ¿ª·¢Õߣ¬ÕÆÎÕJavaScript¿ÉÒÔÔöÇ¿Óû§µÄʹÓÃÌåÑ飬Ìṩ½»»¥¼°¸»¿Í»§¶ËµÈ¹¦ÄÜ¡£
¾¡¹ÜJavaScript µÄÓï·¨·Ç³£¼òµ¥£¬µ«¶ÔÓÚд³ÌÐò¶øÑÔÈÔÈ»ÊÇÀ§ÄÑÖØÖØ£¬¾ÍÊÇÒòΪËüµÄÔËÐл·¾³£º»ùÓÚWebä¯ÀÀÆ÷¡£
ÒÔÏÂÄú¿ÉÒÔ¿´µ½ÊÕ¼¯µÄ8¸öʵÓÃµÄ JavaScrip ......

ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ

JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ