Adjust view automatically according to the clicked item