JS+CSS sets img to show only the vertical center of img in DIV


Img is displayed in a Div. The width of Img is the same as that of Div, but the height is not fixed. Only the vertical center of Img is required to be displayed.

Example:  

The original:

Code implementation:


<div style="width: 190px; height: 100px; overflow: hidden;">

</div>

(link: http://xiazai.jb51.net/201310/yuanma/picjz.rar)