gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Use selectOption for multiple select into a div #349

Open KinG-InFeT opened 8 years ago

KinG-InFeT commented 8 years ago

hi, I need to use the Option select multiple select box here is the example that currently is not working:

<!doctype html>
<html>
    <head>
        <meta charset=utf-8>
        <title>SelectBoxIt demo</title>
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" />
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/base/jquery-ui.css" />
        <link type="text/css" rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <link rel="stylesheet" href="http://gregfranko.com/jquery.selectBoxIt.js/css/jquery.selectBoxIt.css" />
    </head>
    <body>
        <div id="test">
            <select>
                <option value="SelectBoxIt is:" selected>---1--</option>
                <option value="a jQuery Plugin">a jQuery Plugin</option>
                <option value="a Select Box Replacement" >a Select Box Replacement</option>
                <option value="a Stateful UI Widget">a Stateful UI Widget</option>
            </select>
            <select>
                <option value="SelectBoxIt is:" selected>---2--</option>
                <option value="a jQuery Plugin">a jQuery Plugin</option>
                <option value="a Select Box Replacement" >a Select Box Replacement</option>
                <option value="a Stateful UI Widget">a Stateful UI Widget</option>
            </select><select>
                <option value="SelectBoxIt is:" selected>---3--</option>
                <option value="a jQuery Plugin">a jQuery Plugin</option>
                <option value="a Select Box Replacement" >a Select Box Replacement</option>
                <option value="a Stateful UI Widget">a Stateful UI Widget</option>
            </select>
        </div>

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
        <script src="http://gregfranko.com/jquery.selectBoxIt.js/js/jquery.selectBoxIt.min.js"></script>

        <script>

            $(function () {

                setTimeout(function () {

                    var selectBox = $("#test select").selectBoxIt();
                    console.log(selectBox);
                    selectBox.data("selectBoxIt").selectOption(2);

                }, 3000);

                $("select").selectBoxIt();
            });
        </script>
    </body>
</html>

you can get it running?

@gfranko help me please

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28364687-use-selectoption-for-multiple-select-into-a-div?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).