【问题标题】:Dropdownlist on clicking on an image icon we have added in css单击我们在 css 中添加的图像图标的下拉列表
【发布时间】:2016-03-02 15:19:00
【问题描述】:

这是我现有的下拉列表:

@Html.DropDownList("ddlMailSignature", (IEnumerable<SelectListItem>)ViewBag.MailSignature, "Mail Signature", new { @class = "select2" })

是否可以使用我在应用程序中添加的图像获得相同的下拉列表?下面是我的图片的 CSS。

.MailSignature {
  background: url(../img/signature.png) no-repeat;
  width: 20px;
  height: 15px;
  float: right;
}

【问题讨论】:

  • 哦,这个答案是为了在悬停时显示列表。但我猜这对我没有帮助。那么是不是不可能在点击时为图片创建下拉菜单?

标签: javascript jquery html css


【解决方案1】:

目前默认下拉列表无法做到这一点。但是您可以尝试使用可以通过事件打开/关闭的选择框插件。 检查this answer

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-10-27
    • 1970-01-01
    • 2015-01-25
    • 2019-12-24
    • 1970-01-01
    • 2017-09-14
    • 1970-01-01
    相关资源
    最近更新 更多