Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jose Gonzalez 15 posts 98 karma points
    Feb 28, 2015 @ 18:46
    Jose Gonzalez

    Swap images with different cropper sizes


    Is there any way with Slimsy to avoid the downloading of not visible images?

    I have an image with different sizes(different croppers) that will be displayed either on mobile or on desktop.

    Here is the code:

    <img class="visible-mobile" src="@Model.Image.Cropper.GetResponsiveCropUrl(317,238)" alt="" />

    <img class="visible-desktop" src="@Model.Image.Cropper.GetResponsiveCropUrl(147, 363)" alt="" />


    Basically, what I need is to avoid the downloading for an image that will not be displayed.


  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 28, 2015 @ 23:05
    Jeavon Leopold

    That's kind of like a simplified Art Direction, Slimmage is really designed for the image to be same across different devices but with the best sized image loaded depending on the device.

    That said it's probably possible using the Slimmage API and appending your images using JavaScript rather than having them Slimmed automatically, see here for more info

Please Sign in or register to post replies

Write your reply to: