ajax live search,php - jQuery + ajax livesearch - Stack Overflow

皇甫飞跃
2023-12-01

Ah - thanks for the clarification.

The elements you want to drag are being created after the drag/drop initialization. You need make them draggable:

for example, add 'dragMe' as a class to the items. Once the list is populated from the server, then make those items dragable:

$('.dragMe').draggable();

I would really look into jQuery's ajax functions and their autocomplete

To clarify and for jquery (against your cited example):

function showUser(str)

{

$.get( 'getuser.php', { q: str },

function(data) {

$('#txtHint').html( data ); // add the returned content to #txtHint

$('#txtHint').find('.dragItem').draggable(); //make the new items draggable

}, 'html' );

}

In your php, change your display so it is blocks that can be dragged.

while($row = mysql_fetch_array($result))

{

echo "

"; // see how we're adding the 'dragItem' class?

echo "Firstname " . $row['FirstName'];

echo "

";

}

past that, you'll really want to do some more research to get a better idea of whats going on.

 类似资料: