PDA

View Full Version : DOM Drag & Drop Percent Positioning



bfisher
08-11-2006, 06:47 PM
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.

mburt
08-11-2006, 10:35 PM
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.

bfisher
08-14-2006, 01:05 PM
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?

mburt
08-14-2006, 01:11 PM
Ah, I see.. Use percentages, but use it on an external div.

Try this:


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

bfisher
08-15-2006, 06:37 PM
Eureka! That works. Thanks a lot for your help, mburt.