I have 3 divs. One div contains a text box and another one contains a dropdown image. and the next div will have set of values which will be hidden on page load. The 3rd div will be displayed if we click on the second one. If any portion of the 3rd layer extents below visible part of the browser, the layer should expand above the text box(1st div) (this mirrors default behavior of traditional drop-down elements). Can anyone please suggest me how to proceed with this?

Thanks in advance