Nevermind this, i did it the oldschool way with counting elements.
I have a few div's inside a main div. Now the top div has a set width, but it's inside varies in width because of the content in it. So if i'm not mistaken, i need the innerWidth. Whatever the case, in this case it needs to result in a width of 600.
I'm not using jquery but jqui, so i would like it in javascript alone seeing jqui does not have an inner-/outerwidth function. This does mean though that I have a $ selector to play with.
<style> .holder { width:100%; /* which in this case is 320px */ overflow-x: auto; overflow-y:hidden; } .menu_item { width:200px; float:left; } </style> <div class="holder" onscroll="get_width(this)"> <div class="menu_item"> item1 </div> <div class="menu_item"> item2 </div> <div class="menu_item"> item3 </div> </div> get_width(that) { alert(that.innerWidth); // returns undefined alert(that.width); // returns undefined }