On Wed, Aug 5, 2009 at 4:27 AM, Michael Price <[email protected]>wrote:

>  ‘lo all,
>
> I am trying to set up a calendar style conference arrangement tool for a
> client. Times appear down the left hand side, days across the top, and
> sessions in the grid layout. They can be resized to change the timeslots,
> and dragged around to change start times, or days.
>
>
>
> In the initial layout the session boxes (which are <div>) are absolutely
> positioned, but when UI fires, they become relatively positioned and some of
> them then jump out of place. If I drag the first box, the second also moves
> as a side effect.
>

I believe Draggables has support for absolute and relative positioned
elements. Could you share a simplified test page, perhaps put something
together on jsbin.com:

http://jsbin.com/

>
>
> How do I get around this problem, and additionally is there any in-built
> way to prevent two draggables overlapping so that I can’t drag one session
> on top of another?
>

The snap and grid options are a start:

http://jqueryui.com/demos/draggable/#snap-to

but neither will keep them from overlapping. For that you'll need to
calculate the positions of the other draggables in the drag event, and set a
new valid position of the current one being dragged by changing the values
of ui.position.top and ui.position.left. Here's a simple example of setting
those values:

http://jsbin.com/ilape

- Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to