javascript - IE select width issue again... but with short options and jsf -


i resolved ie select width problem of not displaying long values in dropdown menu suggested in article: http://jquerybyexample.blogspot.com/2012/05/fix-for-ie-select-dropdown-with-fixed.html

unfortunately there problem solution when options smaller set default width. in situation code:

drplst.style.width = 'auto'; 

makes combo smaller on mouse down, , bigger on option click make not nice "jumping effect"

i solved code:

                         <script type='text/javascript'>                            function setwidthtoauto(drplst, c) {                                              drplst.style.width = 'auto';                                      if(drplst.clientwidth &lt; c) {                                       drplst.style.width = c.tostring();                                     }                                    else {                                       drplst.style.width = 'auto';                                      }                                 }                              function resetwidth(drplst, c) {                                  drplst.style.width =c.tostring();                                 }                            </script> 

c parameter width want comobox be.

unfortunately ends problem - after changing option, selected value not being displayed (and selected in fact). problem fragment of code solve "jumping effect":

drplst.style.width = c.tostring(); 

because after deleting works fine.

i using jsf , facelests on view site.

i thankful suggestions.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -