Before we start
- You have spaces inside your ids, which are not valid.
- Your first and second ul have the same id, again invalid. I'll assume you
change the second one to sortable2.
This should get you started:
You can make the whatevers draggable:
$("#sortable1 li").draggable({
revert: true
});
and then the defaulttexts droppable:
$("#sortable2 li").droppable({
drop: function(event, ui) {
$(this).text(ui.draggable.text());
}
});
- Richard
On Sun, Feb 1, 2009 at 5:52 PM, [email protected] <
[email protected]> wrote:
>
> I'm trying to drag and drop between lists. I have the simple drag and
> drop down, but I want to add something else...
>
> I want drop a list item to another list item and replace the text or
> the drop zone.
>
> For example. I have two lists:
>
> <ul id="sortable1" class='droptrue'>
> <li id="whatever 1" class="ui-state-default">whatever 1</li>
> <li id="whatever 2" class="ui-state-default">whatever 2</li>
> <li id="whatever 3" class="ui-state-default">whatever 3</li>
> </ul>
>
> <ul id="sortable1" class='droptrue'>
> <li id="default text 1" class="ui-state-default">default text 1</li>
> <li id="default text 2" class="ui-state-default">default text 2</li>
> <li id="default text 3" class="ui-state-default">default text 3</li>
> </ul>
>
> so if I drag "whatever 1" to "default text 1" it would replace
> "default text 1" with "whatever 1"
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---