ConfirmPop(delObj,confirmMain,overlay,binkTitle,closeConfirm,trueConfirm){
this.oDelObj=document.getElementById(delObj);
this.oDiv=document.getElementById(confirmMain);
this.oOverlay=document.getElementById(overlay);
this.oTitle=document.getElementById(binkTitle);
this.oCloseConfirm=document.getElementById(closeConfirm);
this.oTrueConfirm=document .getElementById(trueConfirm);
this.oConStart=0;
this.oConItarget=0;
this.init();
}
ConfirmPop.prototype={
초기화: function(){
this.oConStart=parseInt((document.documentElement.clientHeight-this.oDiv.offsetHeight)/2-100);
this.oConItarget=parseInt((document.documentElement.clientHeight-this. oDiv.offsetHeight)/2-70);
this.oDiv.style.top=this.oConStart 'px';
document.title=this.oConStart ', ' this.oConItarget;
var _this =this;
this.oDelObj.onclick=function(){
_this.confirmShow();
}
this.oOverlay.onclick=function(){
_this.titleB 잉크() ;
}
this.oCloseConfirm.onclick=this.oTrueConfirm.onclick=function(){
_this.confirmHide();
}
},
확인표시: function(){
this.oOverlay.style.display='block';
this.oDiv.style.display='block';
노력Move(this.oOverlay,{ opacity:30});
노력Move(this.oDiv,{top:this.oConItarget, opacity:100})
},
titleBink:function(){
var _this=this;
var iLightTimer=null ;
var i=0;
iLightTimer=setInterval(function(){
if(i%2){
} else{
_this.oTitle.style.Background='#ccc'; > },50)
},
확인숨기기:기능( ){
노력Move(this.oOverlay,{opacity:0});
this.oOverlay.style.display='none';
노력Move(this.oDiv,{top:this.oConStart, 불투명도) :0});
}
}
함수 노력Move(obj,json,fn){clearInterval(obj.iTimer);obj.iTimer=setInterval(function(){var bStop=true;for(var attr json에서){var iCur=0;if(attr=='opacity'){iCur=Math.round(parseFloat(getStyle(obj,attr))*100);}else{iCur=parseInt(getStyle(obj,attr) ));}var iSpeed=(json[attr]-iCur)/8;iSpeed=iSpeed>0?Math.ceil(iSpeed):Math.floor(iSpeed);if(attr=='opacity'){obj. style.filter='alpha(opacity:' (iCur iSpeed) ')';obj.style.opacity=(iCur iSpeed)/100;}else{obj.style[attr]=iCur iSpeed 'px';}if( iCur!==json[attr]){bStop=false;}}if(bStop){clearInterval(obj.iTimer);if(fn){fn();}}},30)}함수 getStyle(obj,attr ){return obj.currentStyle?obj.currentStyle[attr]:getCompulatedStyle(obj,false)[attr];}
사용방법
1. 파일 가져오기
2 .통화 방법
< ;script>
window.onload=window.onresize=function(){
newConfirmPop('btn','div1','overlay','title','closeConfirm','trueConfirm');
}
< /script>
3. 준비
이 코드는 제공됩니다 Space, div 내가 직접 작성한 코드. 확인 상자의 라벨에 삭제된 주소를 입력할 수 있습니다. 확인을 클릭하면 삭제된 페이지 방법으로 이동합니다.