Multiple select listbox without pressing CTRL

后端 未结 1 1546
情话喂你
情话喂你 2021-01-19 04:35

I thought this would be easy to do but I can\'t find a way.

I have a ListBox with selection mode set to multiple but I the user wants to be able to select multiple i

相关标签:
1条回答
  • 2021-01-19 04:53

    Googled it and find the following: http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

    Here is some pointers:

    • Download and reference: https://raw.github.com/ehynds/jquery-ui-multiselect-widget/1.12/src/jquery.multiselect.js

    The just type:

    $(function(){
       $("select").multiselect(); 
    });
    

    Of course you need to reference jQuery as well, and the css to make it look good.

    What the widget does is that it takes an select list and turn it create a list of checkboxes around it and styles them properly.

    A simple jsfiddle example I put together: http://jsfiddle.net/AFVfQ/1/

    It is not perfect, but it should show you how it works. Note the resources on the left hand side, the I'm referencing jquery ui css and a theme.

    0 讨论(0)
提交回复
热议问题