I done a bit of digging around in the interface code, fix by the following:
Line 253 of idrag.js, change from:
{x:0,y:0},
to:
jQuery.iUtil.getPosition(elm.parentNode),
Mike Holloway wrote:
>
> Hi,
>
> I have exactly the same problem, have several <dl> lists and trying to
> order the <dd>'s within, but contain each set to their respective <dl>'s
>
> I have this JS:
>
> function serialize(s){
> serial = $.SortSerialize(s);
> alert(serial.hash);
> };
>
> $('dl').Sortable({
> accept : 'pg',
> activeclass : 'a',
> hoverclass : 'h',
> helperclass : 'h',
> opacity: 0.5,
> fit : false,
> containment: 'parent',
> axis: 'vertically',
> onchange: 'serialize'
> });
>
> When I grab the <dd>, it shoots off to the top of the document and gets
> stuck. It's like it's not finding the correct x and y co-ords of the
> parent <dl>
>
> Also.. am I calling the onchange correctly? Doesn't seem to fire for me.
>
>
>
> tony rasmus wrote:
>>
>> Heya jquery folks,
>>
>> Has anyone implemented a .Sortable with the containment: 'parent'
>> property? Even in a basic test case (below), I receive unexpected
>> behavior when using this property: Most prominent is dragging the first
>> item in a list yet unable to drop/sort it.
>>
>> If this helps, here is a fellow user who also experienced unexpected
>> behavior with 'containment':
>> http://jquery.com/pipermail/discuss_jquery.com/2006-November/016519.html
>>
>> Here is the simple test case:
>>
>> <html><head>
>> <!-- include jquery and interface js files -->
>> <script type="text/javascript">
>> $(document).ready(function () {
>> $('ul#sortlist').Sortable(
>> {
>> accept : 'trigger',
>> containment: 'parent'
>> });
>> });
>> </script>
>> </head>
>>
>> <body>
>> <ul id="sortlist" class="sortable">
>> <li id="item1" class="trigger">Alas my love</li>
>> <li id="item2" class="trigger">ye do me wrong</li>
>> <li id="item3" class="trigger">to cast me off</li>
>> <li id="item4" class="trigger">discourteously.</li>
>> </ul>
>> </body></html>
>>
>
>
--
View this message in context:
http://www.nabble.com/Sortable---is-%27containment%27-implemented--simple-test-case-fails-tf2787726.html#a9512631
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/