Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ʼþ°ó¶¨µÄ·½·¨ËµÃ÷ ÊÕ²Ø
ʼþʹµÃ¿Í»§¶ËµÄ JavaScript Óлú»á±»¼¤»î£¬²¢µÃÒÔÔËÐС£ÔÚÒ»¸ö Web Ò³Ãæ×°ÔØÖ®ºó£¬ÔËÐнű¾µÄΨһ·½Ê½£¬¾ÍÊÇÏìӦϵͳ»òÕßÓû§µÄ¶¯×÷¡£ËäÈ»´ÓµÚÒ»¸öÖ§³Ö½Å±¾±à³ÌµÄä¯ÀÀÆ÷ÃæÊÀÒÔÀ´£¬¼òµ¥µÄʼþ±»ÊµÏÖΪ JavaScript µÄÒ»²¿·Ö£»µ«ÊÇ´ó¶àÊý×î½ü³öÏÖµÄä¯ÀÀÆ÷¶¼ÊµÏÖÁËǿ׳µÄʼþÄ£ÐÍ£¬Ê¹½Å± ......

javascriptÖÐʵÏÖ¶Áȡָ¶¨¸ñʽµÄÈÕÆÚ£¨format£©


javascript
µÄ±àÂëÄÜÁ¦±È½ÏÈõ£¬µ«²¢²»´úÂëËü²»ÄÜ×ö£¬Ö»²»¹ý£¬ÐèÒªÄ㻨һµã¹¦·ò£¬Ç°¶Îʱ¼äÔÚ×öÈÕÀúµÄʱºò£¬ÐèÒª´Ótextbox¶ÁÈ¡ÈÕÆÚ£¬ÎÊÌâµÄ¹Ø¼üÊÇtextbox
µÄÈÕÆÚ¿ÉÄÜÊÇÃÀ¹ú±ê×¼£¬¿ÉÄÜÊÇÖйú±ê×¼µÈµÈ£¬Ã»Óа취½«Ö®×ª³ÉÈÕÆÚ¸ñʽ£¬Ò²¾Í²»Äܽ«ÈÕÆÚÔÚÈÕÀúÖж¨Î»µ½µ±Ìì¡£ÔÚcsdnÉÏÎÊÁËÒ»¸öÎÊÌ⣬½á¹ûûÓÐÈË´ðµÃºÏ
ÊÊ£¬ÎÒÒ»Å­Ö ......

·¢²¼Ò»¸ö»ùÓÚjavascriptµÄÈÕÆÚÀ©Õ¹


javascriptÖжÔÈÕÆÚÊDZȽÏÈõµÄ£¬ÌرðÊÇÈÕÆÚ¸ñʽ»¯ºÍ´Ó×Ö·ûÖлñÈ¡ÈÕÆÚÕâÁ½¸ö¹¦ÄÜÊÇû
Óеģ¬×Ô¼ºÐ´³ÌÐòµÄʱºò·â×°ÁËÕâЩ¹¦ÄÜ£¬·ÖÏíһϣ¬Ï£Íû¶Ô´ó¼ÒÓÐÓá£ÕâЩÀ©Õ¹ÓÐЩÊÇÍøÉÏһЩÅóÓÑдµÄ£¬¾­¹ýÎҵĸÄÔ죬ÓÐЩÊÇÎÒ×Ô¼ºÐ´µÄ¡£
º¯ÊýµÄ¹¦ÄÜ·Ö±ðÊÇ£º
Date.prototype.format =
function(format)£º¸ù¾Ý±í´ïʽ½«ÈÕÆÚ¸ñʽ»¯Îª ......

javascript ¿çä¯ÀÀÆ÷µÄʼþϵͳ2

»º´æÏµÍ³ÎÒÒÔǰÔÚ²©¿Íд¹ýÁË£¬´ËºóÎÒ¶ÔjavascriptµÄÕÜѧ·¢ÉúºÜ´óµÄ¸Ä±ä¡£ÒÔǰÊǾ¡Á¿±ÜÃâ¶ÔÔ­ÐͽøÐÐÀ©Õ¹µÄ£¬µ«·´¹ýÀ´Ò»Ï룬ÓÐʲô¹ØÏµ£¿³ý·ÇÊÇɵ×Ó»òÌØ±ð²ËµÄÈ˲Żá»ìÓöà¸ö¿â£¬ÄÜ»ìÓÿâµÄÈËÒ²Ö»ÓиßÊÖ²ÅÄܱÜÃâÃüÃû³åÍ»µÄÞÏÞΡ£Ê®´óÀà¿âÖУ¬Ç°Ã漸¸ö¶¼ÊǶÔÔ­ÐͽøÐзè¿ñÀ©Õ¹µÄ¡£Ïñmootools£¬´úÂë²»¶à£¬µ«ÄÜʵÔÚ±ÈjQuery¶àÐí¶à ......

javascriptʵÏÖÈÕÆÚÐÇÆÚµÄÏÔʾ

<html>
<body>
<mce:script language=javascript><!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("½ñÌìÊÇ")
document.write("<br>")
if(navigator.appName == "Netscape")
{
document.w ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ