Changing the dropdown list width based on the browser width

2 posts, 0 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 28 Jul 2014 Link to this post

    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
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 30 Jul 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top