Hi all

I'd like to deal with different Image-Variation in our Text-Image-Component, if 
the Client is a "High-Density"-Screen (for example Retina-Display).

With the following JavaScript-Code I can detect, if the Device uses a 
High-Density-Screen:

        function isHighDensity(){
            return ((window.matchMedia && (window.matchMedia('only screen and 
(min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only 
screen and (min-resolution: 48.8dpcm)').matches || window.matchMedia('only 
screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and 
(-o-min-device-pixel-ratio: 2.6/2), only screen and 
(min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 
1.3)').matches)) || (window.devicePixelRatio && window.devicePixelRatio > 1.3));
        }

What I'd like to do now is something like in the following Pseudo-Code: 
...
if(isHighDensity())
   imageRendition = damfn.getRendition(image, "image-with-retina")
else
   imageRendition = damfn.getRendition(image, "image")
...


But clearly I have a Problem, that I couldn't use the JavaScript in the FTL.

But is there a way to handle Images differently depending on the 
Screen-Resolution?

Thanks for any suggestions.

Roland

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=4881b7c4-b70e-4b10-baf5-4a9b3d23c11c


----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to