The best way to handle an object size in a responsive screen is through a relative size on css, like vihan1086 said. This could be made like this:

&lt;div style="width: 75%"&gt;My Content&lt;/div&gt;


This would make this element fill 75% of the screen, no matter the size of the screen.

If you really want to do that in JS, you could do something like this with the help of jQuery

$(window).resize(function() {
  var window_width = $(window).width();
  if(window_width &lt; 300) {
    $("#myDiv").width(100);
  }
});


Change Width of Object on Screen Resize
I have a settings view with a grouped table. One of the cells of such table is intended to show a very long list of items from where I want the user to select one. Due to the length of the list, I need to provide a way to make easier to find a certain item.

One of the options I think there are, is to show letters of alphabet as indexes at the right side of a plain table. Since my first table is a grouped one, my navigation hierarchy would be then like this:

  

Would it be inconsistent to navigate from a grouped table to a plain table? If so, could somebody give an existing example? I didn't find anything related to this in iOS Human Interface Guidelines, maybe it is described somewhere else and this navigation pattern breaks the guidelines.

Another option could be having a search bar. Can a search bar be used in both a plain table and a grouped table? The existing example of such bar I found is in Contacts app and it is a plain table. In a plain table, could both an alphabet index and a search bar be shown?
