imulus/retinajs — pull request #26 by Schnitzel (2012-07-06 11:50:13+00:00)
Title: Checking width & height correctly for hidden images

On http://www.osec.ch/de we have an image slider, which hides the currently not shown Images with display:none. The Problem is now, that ".offsetWidth" returns 0 for hidden images and this causes retina.js to show the @2x image with width=0 and height=0.

This commit adds an additionally check:
- If offsetWidth is not 0 using this value
- If offsetWidth is 0 check if there is an width attribute for the img tag, and use this
- If also no width attribute, stop swapping