语言

简体中文

HOW TO LIST Sortable?

I need to make a list like this http://jqueryui.com/sortable/

What is the solution?

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

4 回复
Marco Buettner
Why you dont click on the link on the "view source" button?
  1. <html lang="en">
  2. <head>
  3. <meta charset="utf-8" />
  4. <title>jQuery UI Sortable - Default functionality</title>
  5. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  6. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  7. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  8. <link rel="stylesheet" href="/resources/demos/style.css" />
  9. <style>
  10. #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
  11. #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
  12. #sortable li span { position: absolute; margin-left: -1.3em; }
  13. </style>
  14. <script>
  15. $(function() {
  16. $( "#sortable" ).sortable();
  17. $( "#sortable" ).disableSelection();
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <ul id="sortable">
  23. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 1</li>
  24. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 2</li>
  25. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 3</li>
  26. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 4</li>
  27. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 5</li>
  28. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 6</li>
  29. <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 7</li>
  30. </ul>
  31. </body>
  32. </html>
Marco Buettner
Don't forget to bind jqueryui.js to your project
Enjo
error: tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js (37) :TypeError: 'undefined' is not a function
Marco Buettner
Share you code.