Hi there,
I am using a hidden to div to create a small popup. I wish to make sure that the popup is not clipped when it is displayed near the edge of the page. My code looks like this:
I need to find NS equivalents of:
[ol]
[li]div.clientWidth
[li]document.body.clientWidth
[/ol]
I believe (2) could use self.innerWidth for NS?
Cheers, Neil
I am using a hidden to div to create a small popup. I wish to make sure that the popup is not clipped when it is displayed near the edge of the page. My code looks like this:
Code:
// initial position
if( ns6 ) {
div.style.left = pageXOffset + e.clientX;
div.style.top = pageYOffset + e.clientY;
} else if( ie5 ) {
div.style.pixelLeft = document.body.scrollLeft + window.event.clientX;
div.style.pixelTop = document.body.scrollTop + window.event.clientY;
}
// some processing of div contents...
if( ns6 ) {
// what goes here?
else if( ie5 ) {
if( div.style.pixelLeft + div.clientWidth > document.body.clientWidth )
div.style.pixelLeft -= div.clientWidth;
if( div.style.pixelTop + div.clientHeight > document.body.clientHeight )
div.style.pixelTop -= div.clientHeight;
}
[ol]
[li]div.clientWidth
[li]document.body.clientWidth
[/ol]
I believe (2) could use self.innerWidth for NS?
Cheers, Neil