javascript - outerWidth() Returns a Different Value when Element is Hidden -
i trying make tweaks jquery ui multiselect widget.
one issue i'm having main control little wide after refresh control. looking @ code, width set using:
var width = this.element.outerwidth();
where this.element
refers original <select>
control, has been hidden jquery ui multiselect widget.
playing around this, can see outerwidth()
returns 424 when <select>
element hidden, , returns 406 when visible. (note width()
returns larger value when element hidden.)
does know why or how width change depending on whether or not control visible? value returned when control visible appears correct value.
edit:
i have created jsfiddle demonstrate this.
you can't width of display:none;
element.
you need hide position:absolute;
, left:-999999px;
.
here css need. don't forget put position:relative
on div wrapper.
jsfiddle : http://jsfiddle.net/7xqk01oa/3/
Comments
Post a Comment