Skip to content

Commit 84391ff

Browse files
Added option for setting custom menu width
Custom menu width can be used in case of lack of space for select, and long text in options. Usage: $('select').multiselect({ minWidth: 100, menuWidth:250 });
1 parent 2489720 commit 84391ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/jquery.multiselect.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
autoOpen: false,
4242
multiple: true,
4343
position: {},
44-
appendTo: "body"
44+
appendTo: "body",
45+
menuWidth:null
4546
},
4647

4748
_create: function() {
@@ -438,7 +439,7 @@
438439
// set menu width
439440
_setMenuWidth: function() {
440441
var m = this.menu;
441-
m.outerWidth(this.button.outerWidth());
442+
m.outerWidth(this.options.menuWidth || this.button.outerWidth());
442443
},
443444

444445
// move up or down within the menu

0 commit comments

Comments
 (0)