enonic/cms-stk — pull request #39 by dmmikkel (2014-04-08 08:19:55+00:00)
Title: Support loading responsive images with display: none

This fixes the issue with hidden images being loaded as the smallest possible size when using STK.responsive.optimizeImages();

It adds a parameter called "scale-by" to stk:image.create. It takes a jQuery selector. If "scale-by" is set, this will load the image not based on it's own size, but based on the size of the first element matched by the selector.

This is useful where you want responsive images to load while being hidden - for example when creating image carousels, because this would enable you to initiate the carousel before STK.responsive.optimizeImages() and thus preventing the page from jumping.