本文介绍了在msdropdown中隐藏数据描述选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从此处
我建立了这样的下拉列表
I build dropdown like this
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
选项
I want to hide description
option when dropdown in displayed
怎么办?
推荐答案
我认为该插件没有为此提供API,但是您可以轻松地使用CSS进行操作
I think this plugin doesn't have an API for that, but you can easily ovverride with CSS
.ddcommon .ddChild{ height: auto !important; }
.ddcommon .ddChild li .description{ display: none; }
.ddcommon .ddChild li img{ float: none !important; }
在此处查看演示: FIDDLE
ps:您还需要仅隐藏子描述或所选元素吗?
ps: you need to hide only child description or the selected element too?
这篇关于在msdropdown中隐藏数据描述选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!