This is a migrated thread and some comments may be shown as answers.

Changing the dropdown list width based on the browser width

1 Answer 60 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 28 Jul 2014, 10:12 PM
So I set my width to auto:
dropdownlist.list.width("auto");

which when the browser is large it works great.  Say the width is around 500px which is what I want (the control is 250px).  But if I move the broswer down to a phone width say 300px, the dropdown list is still at 500px.  Should this auto adjust, or do I need to add an event on the broswer resize

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 30 Jul 2014, 10:53 AM
Hello Dan,

The idea of "width: auto" setting is to adjust the elements with based on its content. For instance, here the dropdownlist changes its width based on the length of the item. If you need to adjust width of an element based on the browser's width then I will suggest you set the width in percents - "width: 100%" is one option.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
danparker276
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Share this question
or