<html>
<head>
<title>www.tutorials.de</title>
<meta name="author" content="Quaese">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
* { margin:0;
padding:0;}
body, html{ width: 100%; height: 100%;}
</style>
<script type="text/javascript">
<!--
// ----------------------------------------------------------------------------------------------
checkIboxContent = function() {
var e = document.getElementById('ibox_content');
if (e.innerHTML.length != 0) {
return true;
}else{
return false;
}
}
showBG = function() {
if (!checkIboxContent()) {
var box_w = document.getElementById("ibox_w"); //getElem('ibox_w');
opacity_level = 80;
box_w.style.opacity = 0;
box_w.style.filter = 'alpha(opacity=0)';
box_w.style.MozOpacity = 0;
// setBGOpacity = setOpacity;
for (var i=0;i<=opacity_level;i+=10) {setTimeout("setIboxOpacity('ibox_w',"+i+")",10*i);}
box_w.style.display = "block";
document.getElementById("ibox_content").innerHTML = "Inhalt aus Ajax";
var pagesize = new getPageSize();
var scrollPos = new getScrollPos();
var ua = navigator.userAgent;
if(ua.indexOf("MSIE") != -1) { box_w.style.width = pagesize.width + 'px'; }
box_w.style.height = pagesize.height + scrollPos.scrollY + 'px';
}else{
alert("Box ist nicht leer");
}
}
function getPageSize(){
this.width = 800;
this.height = 800;
}
function getScrollPos(){
this.scrollY = 0;
}
function setIboxOpacity(strID, dblStep){
var objBoxStyle = document.getElementById(strID).style;
if(document.all && !window.opera){ // IE
objBoxStyle.filter = "alpha(opacity="+dblStep+")";
}else if(objBoxStyle.opacity && !window.sidebar){ // Opera
objBoxStyle.opacity = (dblStep/100);
}else if(window.sidebar){ // Mozilla
objBoxStyle.MozOpacity = (dblStep/100);
}
}
// ----------------------------------------------------------------------------------------------
//-->
</script>
</head>
<body>
<div id="ibox_w" style="position: absolute; width: 100%; height: 100%; background: #000; z-index: 2; display: none;"></div>
<button onclick="showBG();" style="position: absolute; z-index: 3;">showBG()</button>
<button onclick="checkIboxContent();">checkIboxContent()</button>
<div id="ibox_content" style="position: absolute; z-index: 3; background: #fff;"></div>
</body>
</html>