选择项目时,jQuery Multiselect会导致页面调整大小?

时间:2011-11-20 04:08:26

标签: jquery asp.net-mvc-3

我正在使用以下jquery multiselect,当检查/取消选中多选中的所有项目或任何项目时,会导致页面垂直重新调整大小。也就是说,当选择项目时,页面上的所有控件都会向上/向下移动。

如果多页选择页面中包含其他下拉菜单,则似乎会出现此问题。多节选择本身很好。是否有人看到同样的行为,如果有的话,是什么解决方法?

查看:

// Multi-select
@Html.ListBox("TId", null, new { style = "width:190px;" }) 

// Dropdownlist - If this is present page re-sizes vertically. With the following line commented out multiselect doesn't move page when items are selected.
@Html.DropDownListFor(model =>
model.UserId, (SelectList)ViewBag.UserIdList, String.Empty, new { style = "width:165px;" })

<script type="text/javascript">
    $("#TId").multiselect({
        selectedText: "Selected: #",
   minWidth: 210,
   noneSelectedText: "",
   selectedList: 2
});
</script>

1 个答案:

答案 0 :(得分:1)

解决方法可能是通过CSS属性(如边距或填充)来修复菜单的垂直约束。

相关问题