I am looking for a way to dynamically vertically center images inside a fixed height div. I can't make the image a background image. I will have a variety of height images ranging from 300x375 down to 300x240. My height of the inside div is going to be 240 and if the image is taller than 240 I want to center the image. So with one with the height of 375 it would crop of the top and bottom 76.5px. If it was 300 for height it would crop off 30px top and bottom.
I have tried a variety of methods but it seems when I get the larger image to crop correct the smaller ones get messed up.
I will try to work on getting a jsfiddle up but want to get it posted as I am guessing this is fairly simple even though I have been un able to find a solution.