【问题标题】:hide data-description option in msdropdown在 msdropdown 中隐藏数据描述选项
【发布时间】:2016-05-06 16:53:48
【问题描述】:

我正在使用来自 here 的 msdropdown 插件

我像这样构建下拉列表

var jsonData = [
            {
                text: "Facebook",
                value: 1,
               description: "Description with Facebook",
                image: "http://dl.dropbox.com/u/40036711/Images/facebook-icon-32.png"
            },
            {
                text: "Twitter",
                value: 2,

                description: "Description with Twitter",
                image: "http://dl.dropbox.com/u/40036711/Images/twitter-icon-32.png"
            }
            ];
var jsn = $("#byjson").msDropDown({byJson:{data:jsonData, name:'payments'}}).data("dd");

我想在显示下拉菜单时隐藏description 选项

怎么办?

【问题讨论】:

    标签: jquery msdropdown


    【解决方案1】:

    我认为这个插件没有相应的 API,但是你可以很容易地用 CSS 覆盖

    .ddcommon .ddChild{ height: auto !important; }
    .ddcommon .ddChild li .description{ display: none; }
    .ddcommon .ddChild li img{ float: none !important; }
    

    在这里查看演示:FIDDLE

    ps:您也需要隐藏子描述或选定元素吗?

    【讨论】:

      猜你喜欢
      • 2021-12-21
      • 2019-10-04
      • 1970-01-01
      • 1970-01-01
      • 2016-07-31
      • 1970-01-01
      • 1970-01-01
      • 2012-10-23
      • 1970-01-01
      相关资源
      最近更新 更多