Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2012
    Posts
    48
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Draggable div's with images and containment

    Is there a method to doing this properly? I was testing out a grid of draggable objects, and decided to create an image, then a div, then another image inside the draggable object. This works, but containment ceases to work.

    There seems to be a problem when the combination of image/div/image is inside the draggable div. It can be dragged outside containment and shifts everything about.

    If it's image/image it respects containment. If it's just the div inside the draggable object, it respects containment.

    I'm not sure I understand the principle here.

  • #2
    New Coder
    Join Date
    Aug 2012
    Posts
    48
    Thanks
    18
    Thanked 0 Times in 0 Posts
    This has been solved. I'm still looking for a conceptual understanding of why, but if I surround an image with div tags it will cause disruption with the draggable element.

    Simple way to get around it is to encase the central div by two other divs, and just set the images to the background respectively for the top and bottom div.


  •  

    Posting Permissions

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