SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Make div appear at top of parent

    Hi,


    If I was to click a button in #three, I can change the class of the div through .net so if this is the case can I make #two appear at the top of the child list, even though it's not physically there.

    Thanks in advance.
    Why would you want number #2 to go to the top when you click #3?

    I'm not quite sure what you are asking exactly. What do you want to happen to the rest of the list when this item is moved.?

    You could change the class on the clicked item so that that element only becomes absolute and gets placed on top of the whole list - assuming there was some free space above it.

    In essence all you can do is move one item and it would mean that items would need to have a fixed height so that you could work out how much space to allocate.

    I may be misunderstanding what you want though
    Last edited by Paul O'B; May 25, 2010 at 04:58.

  2. #2
    SitePoint Member
    Join Date
    May 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, bad with numbers.

    What essenitally i'm saying is can would make a list order differently by applying a class to it. The div would be an unknow height if container 3 was at the top of the list instead of its natural third position, the resr would need to wrap in beneath it.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,374
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Sorry, I edited your post in error (done that twice today and never done that before ).

    If all the list items were a set height you could add a class to two elements and make them change place by working out the distance between and placing them absolutely into that space. It won't reflow the other elements though.

    I'm not sure how this could be useful exactly so I may be missing the point. Sounds like something for Javascript if you want to dynamically change elements on the fly.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If you are asking how to influence other elements heights upon container 3 being at the top of the list, then no, that is behavior and as such Javascript should be used .

    If that's the case, then head over to the JS forum.

    If not, then disregard (it's slightly hard to understand you )
    Edit:

    Didn't refresh old tab..bah..went to cube some..sorry
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •