added js code to handle non-animated panels with different heights