|
圖1(彈出一個(gè)div)
圖2(彈出多個(gè))
構(gòu)造函數(shù):
復(fù)制代碼 代碼如下:
var DivWindow= function(popup/*最外層div id*/,popup_drag/*拖動(dòng)div id*/,popup_exit/*退出按鈕id*/ ,exitButton/*觸發(fā)服務(wù)器端退出按鈕id*/,varwidth,varheight,zindex){
this.popup =popup ;
this.height =varheight ; //窗口高度,并沒用來設(shè)置窗口高度寬度,用來定位在屏幕的位置
this.width =varwidth ; //窗口寬度
this.popup_exit=popup_exit;
this.exitButton=exitButton;
this.zindex=zindex;
this.init = function(){ //初始化窗口
this.popupShow();
this.startDrag(); //設(shè)置拖動(dòng)
this.setCommond(); //設(shè)置關(guān)閉
DivWindow.ArrayW.push(document.getElementById(this.popup)); //存儲(chǔ)窗口到數(shù)組
};this.init();
};
調(diào)用:
復(fù)制代碼 代碼如下:
<input type="button" id="show" onclick="Javascript:new DivWindow('popup','popup_drag','popup_exit','exitButton','500','700',4);" value='觸發(fā)彈出詳細(xì)基本資料DIV' />
有的地方可能大家覺得有點(diǎn)奇怪,不要問我問什么,因?yàn)槲矣羞@個(gè)需要,有時(shí)間再修改一下遮罩效果。更詳細(xì)代碼請(qǐng)見下載
完整代碼