jquery.fn.loadimage=function(scaling,width,height,loadtext){ if(loadtext==null||loadtext=="") {loadtext="loading..."}; return this.each(function(){ var t=$(this); var src=$(this).attr("src") var img=new image(); img.src=src; var autoscaling=function(){ if(scaling){ if(img.width>0 && img.height>0){ if(img.width/img.height>=width/height){ if(img.width>width){ t.width(width); t.height((img.height*width)/img.width); }else{ t.width(img.width); t.height(img.height); } } else{ if(img.height>height){ t.height(height); t.width((img.width*height)/img.height); }else{ t.width(img.width); t.height(img.height); } } } } } if(img.complete){ autoscaling(); return; } $(this).attr("src",""); var loading=$("
"+loadtext+"
"); t.hide(); t.after(loading); $(img).load(function(){ autoscaling(); loading.remove(); t.attr("src",this.src); t.show(); }); }); } //================================================================================================================================================================ function autourl(a,b) { var urlx=window.location.pathname; var reg=new regexp("/","g"); urlx=urlx.replace(reg,""); urlx=urlx.replace("support",""); urlx=urlx.replace("article2","danye"); urlx=urlx.replace("article1","danye2"); urlx=urlx.replace("article3","danye2"); urlx=urlx.replace("gbook","danye2"); if (urlx=="") { document.getelementbyid(a).classname+=" highlight"; } else { var e=document.getelementbyid(b).childnodes; for(var i = 0; i < e.length; i++) { if (e[i].classname==urlx) { e[i].classname+=" highlight"; } } } } function autocanshu(a,b) { var urlx1=window.location.search; var therequest = new object(); if (urlx1.indexof("?") != -1) { var str = urlx1.substr(1); strs = str.split("&"); } if (strs[0]=="list") { alert(strs[0]); } }