Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery UI Examples - Selectable (Selectable)

jQuery UI Examples - Selectable (Selectable)

Select a single element or a group of elements using the mouse.

For more details about the selectable interaction, see the API documentation Selectable Widget。

Default functionality

Enable selectable functionality on a DOM element or a group of elements. Select items by dragging with the mouse. Hold down the Ctrl key to select multiple non-adjacent items.









  

  jQuery UI 选择(Selectable) - 默认功能

  

  

  

  

 

  

  





 

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6
  7. Item 7

Display as a grid

Make the selectable items display as a grid, using CSS so they have the same size and are floated.









  

  jQuery UI 选择(Selectable) - 显示为网格

  

  

  

  

 

  

  





 

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12

Serialization

Write a function that triggers when the stop event occurs to collect the index values of the selected items. Display these values as feedback or pass them as a data string.









  

  jQuery UI 选择(Selectable) - 序列化

  

  

  

  

 

  

  





 

您已经选择了: 无。

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6