• Hello,

    I can see this plugin working for img elements and use it on pretty much all my projects, but in this instance I have had to change the images on a slider to use background-image as it was the only way I could get them to behave as the client wanted.

    These slider images are pretty big so if there is a way for me to make them responsive, I’m keen to try it.

    I can’t see any srcset attributes being produced (I’m not even sure that srcset works with background-image), so I’m guessing the plugin doesn’t do them. However, I just saw this codepen which seems to do what I’m after:

    https://codepen.io/jessekernaghan/pen/wGjtC

    Is this the right approach? Do you have anything in the pipeline that addresses background-images? Am I missing a trick?

    Many thanks. J

    https://www.ads-software.com/plugins/ricg-responsive-images/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author tevko

    (@tevko)

    Hey Jeremy, thanks for the interesting question. While the plugin doesn’t handle background images, you can get a list of images and sizes for the psuedo srcset tag in that codepen you linked to. Here’s what that would look like in PHP with the plugin installed:

    <?php echo tevkori_get_sizes( yourImageId, 'full' ); ?>

    Did you find a solution for this? I have a similar problem. I am using fullpage.js on my frontpage, and the plugin doesn’t work for me as the images are in the background.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘background-image?’ is closed to new replies.