Results 1 to 5 of 5

Thread: DOM Drag & Drop Percent Positioning

  1. #1
    Join Date
    Sep 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DOM Drag & Drop Percent Positioning

    DOM Drag & Drop script

    http://www.dynamicdrive.com/dynamicindex11/domdrag/

    Hello all. I'd like to know if it's possible to position the root div using a percentage rather than a pixel value. When I do use a % value, upon dragging it, the root div jumps to the right in both FF and IE. If anyone has any input on how this can be done, I'd greatly appreciate it. Thanks in advance.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Why would you want to use a percentage? Drag and drop scripts utilize the "event.clientX", and "event.clientY" events which both use a pixel value, thus converting it to a percentage will cause a problem.
    - Mike

  3. #3
    Join Date
    Sep 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    For the initial positioning. I'd like to position it to the right of the window, not in a way that if the window were resized, the div would be positioned outside of the viewport. Any ideas?

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Ah, I see.. Use percentages, but use it on an external div.

    Try this:

    Code:
    <div style="left:100%;top:0%;position:absolute">
    <div>Menu here</div>
    </div>
    - Mike

  5. #5
    Join Date
    Sep 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Eureka! That works. Thanks a lot for your help, mburt.

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
  •