弹出的div可以一直在浏览器屏幕中间显示 。
代码:
var _CalF = { //便捷方法
$ : function(id){return document.getElementById(id)},
create : function(id){return document.createElement(id)},
append : function(id){return document.body.appendChild(id)},
remove : function(id){return document.body.removeChild(id)}
}
function popup(openID,conID,closeID){
this.onclick(openID,conID,closeID)
}
popup.prototype = {
cssStyle : "width:100%position:absoluteleft:0top:0filter:alpha(opacity = 50)opacity:0.5border:0overflow:auto",
createShadowDiv : function(){ //背景遮罩
var shadowDiv = _CalF.create("div")
shadowDiv.id = "shadowDiv"
shadowDiv.style.cssText = this.cssStyle
shadowDiv.style.height = document.body.scrollHeight + "px"
shadowDiv.style.backgroundColor = "#000"
shadowDiv.style.zindex = 100
_CalF.append(shadowDiv)
},
createIframe : function(){ //iframe
var iframe = _CalF.create("iframe")
iframe.id = "shadowIframe"
iframe.style.cssText = this.cssStyle
iframe.style.height = document.body.scrollHeight + "px"
iframe.style.zindex = 99
_CalF.append(iframe)
},
removeDiv : function(){
_CalF.remove(_CalF.$("shadowDiv"))
_CalF.remove(_CalF.$("shadowIframe"))
},
onclick : function(openID,conID,closeID){
var that = this
_CalF.$(openID).onclick = function(){
if(window.ActiveXObject){ //ie6
if(!window.XMLHttpRequest){
document.body.style.cssText = "_background-image: url(about:blank)_background-attachment: fixed"
}
}
that.createIframe()
that.createShadowDiv()
_CalF.$(conID).style.display = "block"
}
document.getElementById(closeID).onclick = function(){
_CalF.$(conID).style.display = "none"
that.removeDiv()
}
}
}
var bt = new popup("bt","orderMsg","close")
</script>
</body>
</html>
在frontpage2003中,Web组件下面的网页横幅是灰色不可用状态,所以可以在工具菜单中找到横幅广告管理器并添加。具体步骤:
在“工具”菜单上,单击“自定义”;在“自定义”对话框中,单击“命令”选项卡;单击“插入”菜单。右侧列表中找到“横幅广告管理器”命令;选中“横幅广告管理器”,鼠标左键按住不放拖到工具栏上即可。
需要注意的是,这里涉及到一个java程序,没安装的话,即使你找到横幅广告管理器并添加成功,但制作出的网页,图片也只是显示为红色的叉