Loading ...
Sorry, an error occurred while loading the content.

11718Re: [ydn-javascript] Changing order or sort of divs

Expand Messages
  • John A. Vieth
    Apr 3, 2007
      Never mind.  I think I have a solution.  It's not as fancy (no drag-and-drop) but it re-orders divs of all heights and widths and still maintains the proper margin between divs.  Here's my latest example:




      ----- Original Message ----
      From: John Vieth <linux4all@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Tuesday, April 3, 2007 2:55:34 PM
      Subject: [ydn-javascript] Changing order or sort of divs

      Okay, I have a pretty good example working that allows me to move divs

      http://www.masterwe bsmith.com/ testajax. html

      However, the whole thing breaks and becomes very clunky if the divs
      are not of equal height, like in this example:

      http://www.masterwe bsmith.com/ testajaxuneven. html

      Here's what I'm trying to achieve... We're creating a "my profile"
      page for our members that will allow them to display various content
      blocks, like "my recent posts" and "my new photos" and "about me" etc,
      etc... We'd like members to be able to add and remove these content
      blocks from their page, and we'd also like them to be able to drag
      them around to change the order, at which time an AJAX request will
      tell our server to update the database to reflect the new layout.
      That's where this drag-and-drop of divs comes in. There will be a
      column on the left with small blocks that can be rearranged. However,
      these blocks will almost certainly never have uniform heights. So
      while I like the first example that works, I need to change it in
      order to accommodate divs of varying heights. In fact, I don't care
      if I have to lose the fancy animation of the divs switching places.
      They can just instantly appear in the new order for all I care.

      Does anyone have any suggestions for how I can accommodate divs of
      varying heights? Any code or pseudo code would be greatly appreciated.


    • Show all 2 messages in this topic