日期:2014-05-16 浏览次数:20326 次
createDialog: function(flag){ var dialogMark = document.getElementById("dialogMark"); var dialogContent = document.getElementById("dialogContent"); var dialogIframe = document.getElementById("dialogIframe"); if(typeof(dialogContent)=="unfined"||dialogContent==null){ dialogContent = document.createElement("div"); dialogContent.id="dialogContent"; dialogContent.innerHTML="This is a message of dialog."; dialogContent.style.backgroundColor="#FF0000"; dialogContent.style.width="100%"; dialogContent.style.height="100%"; dialogContent.style.border="1px solid #00FFFF"; } if(typeof(dialogMark)=="unfined"||dialogMark==null){ dialogMark = document.createElement("div"); dialogMark.id="dialogMark"; dialogMark.innerHTML="[<a href='#' onclick=\"commonUtils.createDialog('N')\">X</a>]"; dialogMark.style.backgroundColor="#FF00FF"; dialogMark.style.top="100px"; dialogMark.style.left="100px"; dialogMark.style.width="600px"; dialogMark.style.height="300px"; dialogMark.style.position="absolute"; dialogMark.style.filter="alpha(opacity=80)"; dialogMark.style.border="2px solid #00FF00"; dialogMark.appendChild(dialogContent); document.body.appendChild(dialogMark); } if(typeof(dialogIframe)=="unfined"||dialogIframe==null){ dialogIframe = document.createElement("iframe"); dialogIframe.id="dialogIframe"; dialogIframe.style.backgroundColor="#660066"; dialogIframe.style.top="0px"; dialogIframe.style.left="0px"; dialogIframe.style.width=window.screen.availWidth+"px"; dialogIframe.style.height=window.screen.availHeight+"px"; dialogIframe.style.filter="alpha(opacity=20)"; dialogIframe.style.position="absolute"; //dialogIframe.appendChild(dialogMark); document.body.appendChild(dialogIframe); } if(flag=="Y"){ dialogIframe.style.zIndex=10000; dialogMark.style.zIndex=10001; dialogContent.style.zIndex=10002; dialogIframe.style.display=""; dialogMark.style.display=""; dialogContent.style.display=""; }else{ dialogIframe.style.zIndex=-1; dialogMark.style.zIndex=-2; dialogContent.style.zIndex=-3; dialogIframe.style.display="none"; dialogMark.style.display="none"; dialogContent.style.display="none"; } }
<div id="dialogMark" class="dialogMark"> [<a href="#">X</a>] <div id="dialogContent" class="dialogContent" onmouseout="commonUtils.showNoteDialog('N')">This is a message of dialog.</div> </div>
showNoteDialog: function(flag){ var dialogMark = document.getElementById("dialogMark"); var dialogContent = document.getElementById("dialogContent"); var dialogIframe = document.getElementById("dialogIframe"); dialogMark.style.left = currMouseClickX + "px"; dialogMark.style.filter = "alpha(opacity=80)"; if (typeof(dialogIframe) == "undefined" || dialogIframe == null) { dialogIframe = document.createElement("iframe"); dialogIframe.id = "dialogIframe"; dialogIframe.style.backgroundColor = "#ADD8E6"; dialogIframe.style.top = "0px"; dialogIframe.style.left = "0px"; var width = window.screen.