Re: Window widget placement
Michael Flanagan <[email protected]> Tue, 18 Nov 2003 14:08:57 -0800
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
Hey David,
If they're within a table their offset top and left area going to be
different. Other than that though, you should be able to just get the
position of the element using somthing along the lines of:
var topOffset = document.getElementById("idOfYourElement").offsetTop;
We've also added the following to utility_core.js but have yet to check
it into CVS head. I havn't gotten around to doing a sync rescently. You
can paste it into your utility_core.js and it though if you find it useful.
this.getPosition = function( coord, node ) {
var pos= 0;
while(node) {
pos += node["offset" + coord];
node = node.offsetParent;
}
return pos;
}
This code only works if your node is within a table.
Let us know if this works.
Cheers,
Michael
David Peterson wrote:
> Dear Alex,
>
> On my page I have links that appear next to content blocks. When these
> links are clicked I want a window widget to pop-up right underneath the link
> (the use can then do some editing tasks and close the window). As the
> hyperlinks are in the normal flow of the document there is no way to easily
> determine there absolute positions, so being able to pace a reference to an
> element to the window constructor would be great.
>
> thanks,
>
> David
>
> -----Original Message-----
> On Thursday 13 November 2003 4:07 pm, David Peterson wrote:
>
>>If I open up a NetWindow window widget using a hyperlink embedded
>>in a page, how do I lock the location of that window to just below
>>the hyperlink that is clicked? Currently I can just use absolute
>>positioning, but in the window constructor, can I pass a reference
>>to the hyperlink so it is created under it? Thanks.
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org