I played it more around it and took some pieces from Superdrac and https://stackoverflow.com/a/8342709/779965
Here is my code that is test and it works:
var height_last_element_rads = $('select[name^="rs"]:last').offset().top;
var height_first_element_rads = $('select[name^="rs"]:first').offset().top;
var height_text_area = height_last_element_rads - height_first_element_rads;
$('#xray_expected_reads_data').height( height_text_area );
- Basically offset gives us top from the top of the screen;
- Then we take offset top from first element and last element
- Subtract those two offsets we get.
- Add result value as height for textarea
Here are also the images:
Firebug debug End result