没什么好说的,都是js,用一个iframe将页面遮挡,iframe上面一个div层,js面向对象做的,其中有部分是js动态生成style。ModeWindow.js 复制代码 代码如下: Untitled Page <BR>var myWin; <BR>function show1(){ <BR>var divtest = document.getElementById("divtest"); <BR>divtest.style.display="block"; <BR>myWin = new ModeWindow(divtest,200,300,300,100,"i change!"); <BR>myWin.show(); <BR>} <BR>function show2(){ <BR>var tbtest = document.getElementById("tbtest"); <BR>tbtest.style.display="block"; <BR>//myWin = new ModeWindow(tbtest); <BR>myWin = new ModeWindow(tbtest,200,200,200,222,"hello world!"); <BR>myWin.show(); <BR>} <BR>function Winclose() <BR>{ <BR>myWin.close(); <BR>} <BR> 我来了! 在线演示 http://img.jb51.net/online/ModeWindow/index.htm