You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 27, 2021. It is now read-only.
Вычисляя ширину выпадающего списка, еще можно учитывать если в списке прокрутка. Полоса прокрутки съедает (в моем случае) 20пкс и текст переносит на новую строку. Я это решил проверяя общую высоту всех элементов в списке и фактическую высоту списка. Если высота списка меньше высоты всех элементов, прибавлял к максимальной ширине 20пкс. // определяем самый широкий пункт селекта var liWidthInner = 0, liWidth = 0, liAllHeight = 0; li.css({'display': 'inline-block'}); li.each(function() { var l = $(this); liAllHeight += l.outerHeight(); if (l.innerWidth() > liWidthInner) { liWidthInner = l.innerWidth(); liWidth = l.width(); } }); liWidthInner = ul.outerHeight() < liAllHeight ? liWidthInner + 20 : liWidthInner ;