首页 > 代码库 > pop
pop
var draw = function() { // var time = new Date().getTime(); mWindow = lw.create(‘div‘); document.body.appendChild(mWindow); mWindow.style.display = ‘none‘; var windowId = ‘lwWindow_‘ + time; mWindow.setAttribute(‘id‘, windowId); mWindow.setAttribute(‘class‘, ‘lwWindow‘); mWindow.style.width = document.body.scrollWidth + ‘px‘; mWindow.style.height = document.body.scrollHeight + ‘px‘; mDialog = lw.create(‘div‘); document.body.appendChild(mDialog); mDialog.style.display = ‘none‘; var dialogId = ‘lwDialog_‘ + time; mDialog.setAttribute(‘id‘, dialogId); mDialog.setAttribute(‘class‘, ‘lwDialog‘); mDialog.style.width = mWidth + ‘px‘; mDialog.style.height = mHeight + ‘px‘; var pageWidth = Math.min(window.screen.availWidth, document.body.clientWidth); var pageHeight = Math.min(window.screen.availHeight, document.body.clientHeight); var top = document.documentElement.scrollTop - 100 + (pageHeight - mHeight) / 2; var left = document.documentElement.scrollLeft + (pageWidth - mWidth) / 2; if (top < 0) { top = 100; } if (left < 0) { left = 100; } mDialog.style.top = top + ‘px‘; mDialog.style.left = left + ‘px‘; // ... }
.lwWindow { position: absolute; left: 0px; top: 0px; margin: 0; padding: 0; background-color: gainsboro; filter: alpha(opacity = 50); -moz-opacity: 0.5; -khtml-opacity: 0.5; opacity: 0.5;}.lwDialog { position: absolute; overflow: hidden; border: 2px solid lightblue; background-color: white;}
pop
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。