2选择框过滤器

时间:2013-07-21 17:46:05

标签: javascript jquery html filter drop-down-menu

我已阅读本教程的selectbox过滤器: http://www.cssnewbie.com/intelligent-select-box-filtering/#.Uewddo30FGg http://www.lessanvaezi.com/filter-select-list-options/ Selecting options and filter values in select box jquery

有些例子非常大,我有2个选择框,在第一个选择框中我只有3个托盘,我怎么能用最简单的方法过滤第二个选择框,我也试过这个:

        function cascadeSelect(parent, child){
        var childOptions = child.find('option:not(.static)');
        child.data('options',childOptions);

        parent.change(function(){
                childOptions.remove();
                child
                .append(child.data('options').filter('.sub_' + this.value))
                .change();
        });

        childOptions.not('.static, .sub_' + parent.val()).remove();

    }

    var $j = jQuery.noConflict();

    //$j(document).ready(function(){
        cascadeForm = $j('.cascadeTest');
        orgSelect = cascadeForm.find('.orgSelect');
        terrSelect = cascadeForm.find('.terrSelect');
        cascadeSelect(orgSelect, terrSelect);
    //});

只有当我通过“文件”协议调用文件,而不是http ...

时才由我工作

0 个答案:

没有答案
相关问题