问题描述
如题我自己已经写好了一个JS上传附件的进度条具体怎么在domino里面调用这个JS<html><head><linkhref="css/jquery-ui-1.8.16.custom.css"rel="stylesheet"type="text/css"/><linkhref="css/main.css"rel="stylesheet"type="text/css"/><scripttype="text/javascript"src="js/jquery-1.6.2.min.js"></script><scripttype="text/javascript"src="js/jquery-ui-1.8.16.custom.min.js"></script><scriptlanguage=JScript>varx0=0,y0=0,x1=0,y1=0;varoffx=6,offy=6;varmoveable=false;varhover='orange',normal='slategray';//color;varindex=10000;//z-index;varxx;//开始拖动;functionstartDrag(obj){if(event.button==1){//锁定标题栏;obj.setCapture();//定义对象;varwin=obj.parentNode;varsha=win.nextSibling;//记录鼠标和层位置;x0=event.clientX;y0=event.clientY;x1=parseInt(win.style.left);y1=parseInt(win.style.top);//记录颜色;normal=obj.style.backgroundColor;//改变风格;obj.style.backgroundColor=hover;win.style.borderColor=hover;obj.nextSibling.style.color=hover;sha.style.left=x1+offx;sha.style.top=y1+offy;moveable=true;}}//拖动;functiondrag(obj){if(moveable){varwin=obj.parentNode;varsha=win.nextSibling;win.style.left=x1+event.clientX-x0;sha.style.left=parseInt(win.style.left)+offx;if((y1+event.clientY-y0)>0&&(y1+event.clientY-y0)<600){win.style.top=y1+event.clientY-y0;sha.style.top=parseInt(win.style.top)+offy;}}}//停止拖动;functionstopDrag(obj){if(moveable){varwin=obj.parentNode;varsha=win.nextSibling;varmsg=obj.nextSibling;win.style.borderColor=normal;obj.style.backgroundColor=normal;msg.style.color=normal;sha.style.left=obj.parentNode.style.left;sha.style.top=obj.parentNode.style.top;obj.releaseCapture();moveable=false;}}//获得焦点;functiongetFocus(obj){if(obj.style.zIndex!=index){index=index+2;varidx=index;obj.style.zIndex=idx;obj.nextSibling.style.zIndex=idx-1;}}//最小化;functionmin(obj){varwin=obj.parentNode.parentNode;varsha=win.nextSibling;vartit=obj.parentNode;varmsg=tit.nextSibling;varflg=msg.style.display=="none";if(flg){win.style.height=parseInt(msg.style.height)+parseInt(tit.style.height)+2*2;sha.style.height=win.style.height;msg.style.display="block";obj.innerHTML="0";}else{win.style.height=parseInt(tit.style.height)+2*2;sha.style.height=win.style.height;obj.innerHTML="2";msg.style.display="none";}}//关闭;functioncls(obj){varwin=obj.parentNode.parentNode.parentNode;win.style.visibility="hidden";}//显示/隐藏;functionShowHide(){if(xx!=null)if(xx.style.visibility=="hidden")xx.style.visibility="visible";elseif(xx.style.visibility=="visible")xx.style.visibility="hidden";}//创建一个对象;functionxWin(id,w,h,l,t,tit,msg){index=index+2;this.id=id;this.width=w;this.height=h;this.left=l;this.top=t;this.zIndex=index;this.title=tit;this.message=msg;this.obj=null;this.bulid=bulid;this.bulid();xx=document.getElementById('allx');xx.style.visibility="visible";}//初始化;functionbulid(){varstr=""+"<divid='allx'><divid='xMsg'"+this.id+""+"style='"+"z-index:"+this.zIndex+";"+"width:"+this.width+";"+"height:"+this.height+";"+"left:"+this.left+";"+"top:"+this.top+";"+"background-color:"+normal+";"+"color:"+normal+";"+"font-size:11px;"+"font-family:Verdana;"+"position:absolute;"+"cursor:default;"+"border:2pxsolid"+normal+";"+"'"+"onmousedown='getFocus(this)'>"+"<div"+"style='"+"background-color:"+normal+";"+"width:"+(this.width-2*2)+";"+"height:20;"+"color:white;"+"'"+"onmousedown='startDrag(this)'"+"onmouseup='stopDrag(this)'"+"onmousemove='drag(this)'"+"ondblclick='min(this.childNodes[1])'"+">"+"<spanstyle='width:"+(this.width-2*14-4)+";padding-left:3px;'>"+this.title+"</span>"+"<spanstyle='width:14;border-width:0px;color:white;font-family:webdings;'onclick='min(this)'>0</span>"+"<spanid='close'style='width:14;border-width:0px;color:white;font-family:webdings;'onclick='cls(this)'>r</span>"+"</div>"+"<divstyle='"+"width:100%;"+"height:"+(this.height-20-4)+";"+"background-color:white;"+"line-height:14px;"+"word-break:break-all;"+"padding:3px;"+"'>"+this.message+"</div>"+"</div>"+"<divid='xshadow'style='"+"width:"+this.width+";"+"height:"+this.height+";"+"top:"+this.top+";"+"left:"+this.left+";"+"z-index:"+(this.zIndex-1)+";"+"position:absolute;"+"background-color:black;"+"filter:alpha(opacity=40);"+"'>bywildwind</div></div>";//alert(str)document.getElementById('msgbox').innerHTML=str;}</script><scriptlanguage='JScript'>functioninitialize(){varstr="<divclass='example'><divid='progress3'><divclass='percent'></div><divclass='pbar'></div>"+"<divclass='elapsed'></div></div></div>";vara=newxWin("1",660,200,200,200,"文件上传",str);}</script><script>$(document).ready(function(){initialize();jQuery.fn.anim_progressbar=function(aOptions){//defvaluesvariCms=1000;variMms=60*iCms;variHms=3600*iCms;variDms=24*3600*iCms;//defoptionsvaraDefOpts={start:newDate(),//nowfinish:newDate().setTime(newDate().getTime()+60*iCms),//now+60secinterval:100}varaOpts=jQuery.extend(aDefOpts,aOptions);varvPb=this;//eachprogressbarreturnthis.each(function(){variDuration=aOpts.finish-aOpts.start;//callingoriginalprogressbar$(vPb).children('.pbar').progressbar();//loopingprocessvarvInterval=setInterval(function(){variLeftMs=aOpts.finish-newDate();//lefttimeinMSvariElapsedMs=newDate()-aOpts.start,//elapsedtimeinMSiDays=parseInt(iLeftMs/iDms),iHours=parseInt((iLeftMs-(iDays*iDms))/iHms),iMin=parseInt((iLeftMs-(iDays*iDms)-(iHours*iHms))/iMms),iSec=parseInt((iLeftMs-(iDays*iDms)-(iMin*iMms)-(iHours*iHms))/iCms),iPerc=(iElapsedMs>0)?iElapsedMs/iDuration*100:0;$(vPb).children('.percent').html('<b>'+iPerc.toFixed(1)+'%</b>');$(vPb).children('.elapsed').html(iDays+'days'+iHours+'h:'+iMin+'m:'+iSec+'s</b>');$(vPb).children('.pbar').children('.ui-progressbar-value').css('width',iPerc+'%');//incaseofFinishif(iPerc>=100){clearInterval(vInterval);$(vPb).children('.percent').html('<b>100%</b>');$(vPb).children('.elapsed').html('Finished');varobj=document.getElementById("close");cls(obj);alert("上传成功")window.close();}},aOpts.interval);});}$('#progress3').anim_progressbar({interval:100});});</script></head><bodyonselectstart='returnfalse'oncontextmenu='returnfalse'scroll='no'bgColor="transparent"><divid="msgbox"></div></body></html>
解决方案
解决方案二:
测试了你的代码没有成功。