Your script won't work because it doesn't know what the var serial is. It's
an undefined variable and therefore, it outputs exactly that. Nothing.
Lets look at the source for the sortable demo...
function serialize(s)
{
serial = $.SortSerialize(s);
alert(serial.hash);
}
As you can see, serial is declared as $.SortSerialize(s) (s being the id of
the list (in your case, "serial = $.SortSerialize('sort1');".
>From there you can reference it.
Doing the following should help:
# list
It's a bit messy though.
Hope this helps.
kevdotbadger wrote:
>
> <body>
> <div>
> <ul style="" class="sortable" id="sort1">
> <li style="" class="sortableitem" id="item1">item 1</li>
> <li style="" class="sortableitem" id="item2">item 2</li>
> <li style="" class="sortableitem" id="item3">item 3</li>
> </ul>
> </div>
> <script type="text/javascript">
> $(document).ready(
> function () {
> $('ul').Sortable(
> {
> accept : 'sortableitem',
> activeclass : 'sortableactive',
> hoverclass : 'sortablehover',
> helperclass : 'sorthelper',
> opacity: 0.8,
> fx: 200,
> revert: true,
> tolerance: 'intersect'
> }
> )
> }
> );
> </script>
> <div class="serializer">
> # list
> </div>
> <p id="myserialhash">as</p>
> </body>
>
>
> is what i got at the moment but it doesnt display it? Obviously the head
> of the document loads scripts and styles so no need to copy n paste that.
>
> Dan Atkinson wrote:
>>
>> I don't know. I didn't try it, as I used to use innerHTML or html() but
>> it's not as widely used now for some reason.
>>
>> :-)
>>
>> One of them will work.
>>
>>
>> Karl Swedberg-2 wrote:
>>>
>>>
>>> On Sep 18, 2006, at 8:47 AM, Dan Atkinson wrote:
>>>
>>>> $("p#myseralhash").text(serial.hash);
>>>
>>> I thought text() couldn't take arguments, i.e. it's only a getter,
>>> not a setter.
>>>
>>> If so, try this instead: ("p#myseralhash").html(serial.hash);
>>>
>>> If not, ignore this email. :)
>>>
>>> Karl
>>> ___________________
>>> Karl Swedberg
>>> www.engrish.com
>>> www.learningjquery.com
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/interface-sotables-question-tf2285730.html#a6385613
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/