PDA

View Full Version : Help with mini window script



aznkpballer
10-23-2004, 06:26 PM
How do i center the window?
the link is http://dynamicdrive.com/dynamicindex8/dhtmlwindow.htm

cr3ative
10-23-2004, 06:28 PM
Replace the following script function:



function loadwindow(url,width,height){
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"
// Modified script starts here
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
document.getElementById("dwindow").style.left=(winW/2) - (width/2)
document.getElementById("dwindow").style.top=(winH/2) - (height/2)
// Modified script ends here
document.getElementById("cframe").src=url
}
}



cr3ative

aznkpballer
10-23-2004, 06:52 PM
thanks for your help