Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Absolute positining of nested custom controls

Reply
Thread Tools

Absolute positining of nested custom controls

 
 
Nick Stansbury
Guest
Posts: n/a
 
      04-19-2005
Hi,

I am trying to produce a series of web controls which will always
position themselves at the very top left hand corner of the page. However
I've come across a problem that should have been obvious - which is that
when the controls are nested several layers deep inside div's (which is
unavoidable) - up to n-layers deep - they position themselves absolutely -
but only relative to the top left hand corner of their parent div:

Now I know that if every div the tree is positioned absolutely I can
use the offsetParent property in a dhtml function to recurse up the tree and
add them together to correctly position the div to the top left - however I
can't find a way of continuing to recurse up the tree using the offset
parent if any of the div's aren't positioned absolutely.

Is there an easy way to get around this problem? Am I missing something
obvious? Can anyone help?

Thanks

Nick

i.e

<div id=myWebControl1>
<span>
Label text:
</span>
<input tpe=text>bah</input>
<div id=mWebControl2>
<div id=mWebCotrol3> <!-- Take this control and position it
absolutely to the top left hand corner at 0,0-->
</div>
</div>
</div>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does one get an absolute absolute file path? James Byrne Ruby 3 09-14-2010 06:02 PM
absolute newbie: divide a list into sublists (nested lists?) of fixedlength ergconcepts@googlemail.com Python 7 04-11-2009 10:36 PM
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
Custom Controls and Absolute Positioning Rick Strahl [MVP] ASP .Net Building Controls 1 12-11-2006 09:22 AM
Nested controls in custom tab control Marius Trælnes ASP .Net 4 01-03-2005 06:49 PM



Advertisments