A big thank you to both Jordy and Jamie for bringing this up. I was having exactly the same problem with hidden images in a slideshow.
I was just wondering if you could help me though? When I comment out the lines, the hidden images are displayed correctly but my website logo (which is also being differentiated using the retina.js script) resizes itself. My logo is 200 x 200 (with a retina version at 400 x 400). When I comment out the lines, the full 400 x 400 version is displayed.
I’m stumped…wondered if you could shed any light for me?
Sam