PDA

View Full Version : dhtml windows help please



dgm
03-21-2006, 04:41 AM
Re: http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow.htm

I'm trying to place the window further down from the top on the browser screen.

Is there a way to set top position in the script? I can't find it, or don't know.

I thank anyone in advance, who may be able to help me.

jscheuer1
03-21-2006, 05:03 AM
Here is where in the script that the window is initialized:


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"
document.getElementById("dwindow").style.left="30px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
document.getElementById("cframe").src=url
}
}

The two red 30's control how many pixels from the top that the window first appears. The first one is for virtually all browsers except IE, the second one's mainly for IE.

dgm
03-21-2006, 05:40 AM
What is they say?
Ask and you shall receive. John, your a Saint.

One more question.
Anyway to remove the bar and icon from the top of the window?
And I guess I use false, so they can't drag.


Again thank you very much John.

dgm :)

jscheuer1
03-21-2006, 03:21 PM
I'm not sure what you mean by icon. The bar and control images can be removed by removing this from the HTML portion:


<div align="right" style="background-color:navy"><img src="max.gif" id="maxname" onClick="maximize()"><img src="close.gif" onClick="closeit()"></div>

But, then it will be hard to close unless that is what you want.

For no dragging, get rid of these as well:


onMousedown="initializedrag(event)" onMouseup="stopdrag()" onSelectStart="return false"

dgm
03-22-2006, 02:04 PM
That is exactly what I needed to know.

Thank you very much.:)