SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast Dolbex's Avatar
    Join Date
    Jun 2003
    Location
    Confused USA
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting one DIV to "jump" to another parent DIV?

    Basically, I have a drag and drop situation that is working just fine, however, to speed up the system I want to create a button that would allow a list to automatically be moved to another list.

    ie:

    Parent DIV1 contains: DIVa
    Parent DIV2 contains: nothing

    (User clicks a button in DIVa)

    Parent DIV1 contains: nothing
    Parent DIV2 contains: DIVa

    Sounds simple, but I can't seem to quite wrap my head around this one...

    Thanks for any advice you might have!

    Kind regards,
    Dolbex

  2. #2
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    Location
    South Dakota
    Posts
    215
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i made a quite complex category mover a few months ago... and what i did is use this system:

    http://www.sitepoint.com/article/hie...-data-database

    however... if you dont want to do something that complex... you could just loop though that div's chiled nodes

    Code:
    while(currentDiv = curentDiv.childNode){
      for(i=0;i<currentDiv.length;i++){
        //currentDiv is now one of the children
      }
    }
    aslong as currentDiv is the parent to startwith you can get all the children no matter how deep they are in it (but this particular code will skip the first div's children so you will need to have just the for() ststment above it.
    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site

  3. #3
    SitePoint Enthusiast Dolbex's Avatar
    Join Date
    Jun 2003
    Location
    Confused USA
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ALL.

    This reference also helped: http://www.daveshuck.com/blog/index....-using-the-DOM


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
  •