jquery.amsify.suggestags.js jquery标签自动完成提示输入插件

jquery.amsify.suggestags.js jquery标签自动完成提示输入插件

jquery.amsify.suggestags.js jquery标签自动完成提示输入插件

第一步引入bfwone 加载依赖项jquery

第二步执行插件

示例如下

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>BFW NEW PAGE</title>
    <script id="bfwone" data="dep=jquery-3.4.1.min&err=0" type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
    <script type="text/javascript">
        bready(function() {
            use(["jquery.amsify.suggestags", "amsify.suggestags"], function() {
                $('input[name="country"]').amsifySuggestags({
                    type: 'amsify'
                });
                $('input[name="color"]').amsifySuggestags({
                    type: 'amsify',
                    suggestions: ['Black', 'White', 'Red', 'Blue', 'Green', 'Orange']
                });
                $('input[name="toAjax"]').amsifySuggestags({
                    type: 'amsify',
                    suggestionsAction: {
                        url: 'jquery-plugins/suggestags/examples/suggestions.php'
                    }
                });
                $('input[name="planets"]').amsifySuggestags({
                    type: 'amsify',
                    suggestions: ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupitor', 'Uranus', 'Neptune', 'Pluto'],
                    whiteList: true
                });
                $('input[name="anything"]').amsifySuggestags({
                    type: 'amsify',
                    tagLimit: 5
                });
            });
        });
    </script>
</head>
<body>
    <header>
        <div class="container">
            <h1 class="text-center">Jquery Suggestags</h1>
        </div>
    </header>
    <div class="container" style="min-height:360px;">
        <div class="col-md-3"></div>
        <div class="col-md-6 text-center">
            <div class="form-group">
                <input type="text" class="form-control" name="country" />
            </div>
            <br><br>
            <h4>Already Selected</h4>
            <div class="form-group">
                <input type="text" class="form-control" name="color" value="Orange,Black" />
            </div>
            <h4>Suggestions through Ajax</h4>
            <div class="form-group">
                <input type="text" class="form-control" name="toAjax" />
            </div>
            <h4>White Listed</h4>
            <div class="form-group">
                <input type="text" class="form-control" name="planets" value="Earth,Mars" />
            </div>
            <h4>Tag Limit</h4>
            <div class="form-group">
                <input type="text" class="form-control" name="anything" value="one,two,three,four,five,six" />
            </div>
        </div>
        <div class="col-md-3"></div>
    </div>
    <footer>
        <div class="container">
            <h1 class="text-left">Usage</h1>
            <pre>
                <code>
                    $('input[name="country"]').amsifySuggestags({
                    type : 'amsify'
                    });
                    $('input[name="color"]').amsifySuggestags({
                    type : 'amsify',
                    suggestions: ['Black', 'White', 'Red', 'Blue', 'Green', 'Orange']
                    });
                    $('input[name="toAjax"]').amsifySuggestags({
                    type : 'amsify',
                    suggestionsAction : {
                    url : 'jquery-plugins/suggestags/examples/suggestions.php'
                    }
                    });
                    $('input[name="planets"]').amsifySuggestags({
                    type : 'amsify',
                    suggestions: ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupitor', 'Uranus', 'Neptune', 'Pluto'],
                    whiteList: true
                    });
                    $('input[name="anything"]').amsifySuggestags({
                    type : 'amsify',
                    tagLimit: 5
                    });
                </code>
            </pre>
        </div>
    </footer>
    <!-- -->

</body>
</html>

官网 https://github.com/amsify42/jquery.amsify.suggestags#simple-tags
立即下载jquery.amsify.suggestags.js查看所有js插件

网友评论0

程序员在线工具箱