I've done some more debugging. I put this in a long time ago and had forgotten how it works. I combined the script with a background script I had basically developed code I got from http://www.alistapart.com/articles/customcorners/ and http://www.vertexwerks.com/tests/sidebox/.
My relevant Header data looks like this:
Code:
<style type="text/css">
<!--
/* Show only to IE PC \*/
* html .boxhead h2 {height: 1%;} /* For IE 5 PC */
.boxbar {
background: url('images/Edge2_bar.gif') no-repeat bottom left;
margin: 0;
padding-left:0px; padding-right:0px; padding-top:0px; padding-bottom:0px
}
.boxbody {
background: url('images/Edge2_body.gif') no-repeat bottom left;
margin: 0;
padding-left:0px; padding-right:0px; padding-top:0px; padding-bottom:0px
}
.widthlessbox {
margin: 0 25%; /* NO WIDTH! Opens up a world of possibilities! */
background: url(sbbody-r.gif) no-repeat bottom right;
font-size: 100%;
}
-->
</style>
<script>
//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm
var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var toppos,leftpos
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function loadwindow(url,width,height,leftpos,toppos){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left=leftpos+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+toppos+"px" : iecompattest().scrollTop*1+toppos+"px"
document.getElementById("cframe").src=url
}
}
function closeit(){
document.getElementById("dwindow").style.display="none"
}
</script>
And the body code looks like:
Code:
<div id="dwindow" style="position:absolute;background-color:transparent;cursor:hand;left:210px;top:140px;display:none" onSelectStart="return false">
<div align="left" ><img src="images/Edge2_top.gif" width="594" height="12"></div>
<div align="left" style="background-color:rgb(222,222,222)"><img src="images/Edge2_bar.gif" onClick="closeit()" width="594" height="14"></div>
<div id="dwindowcontent" style="height:100%" class=boxbody>
<iframe id="cframe" src="" width=550 height=100% hspace=22 frameborder="0"></iframe>
</div>
<div align="left" ><img src="images/Edge2_bottom.gif" width="594" height="12"></div>
</div>
I have no idea why I am not using the CSS code for the classes. Most likely because I didn't know what I was doing.
How do I modify this code so it is compatible with both IE and Firefox, and NS for that matter? I don't know how to check for the various browsers, nor do I understand why they react differently to the code.
Thanks,
Thomas
www.flyingscool.com
Bookmarks