4

Does anyone know a detailed and effective jQuery UI 1.7 tutorial out there? I just can't do it with the demo page alone.

I can't figure out the drag and drop.. With just doing the ('div#item').draggable();

Thanks

4

2 回答 2

8

i like this one:

http://www.learningjquery.com/2008/07/introduction-to-jquery-ui

also, try

$('div#item').draggable():
于 2009-03-20T12:26:35.143 回答
3

To use jQuery draggable, you need to :

  1. Include jquery.js, jquery.ui.core.js and jquery.draggable in your page
  2. Declare a <div id="item">Some content</div>
  3. Set a width and height to your div in your css : #item { width: 100px; height: 100px; }
  4. Call the jQuery draggable() extension : $('div#item').draggable();

Of course, 2 and 3 can be done together:

<div id="item" style="width: 100px; height: 100px;">Some content</div>
于 2009-03-20T12:31:14.820 回答