riloadr
riloadr copied to clipboard
Is it possible to only load images above a certain breakpoint?
Hi,
Is it possible to use riloadr in a scenario where you load no image for mobile and just, for example 768px and above? This does appear to work in a quick test, just having the one breakpoint, but obvisouly displays a failed image path / icon below this width.
This can be cleared up with a bit of a hack using it alongside display: none; in the css to hide the broken image graphic, but just wondered if there was a neater way to achieve this?
My only thoughts at the moment are possibly using a 1px spacer image, so that a full path is displayed, but there may be a suggested / correct way to achieve this.
Thanks in advance.
Any ideas / suggestions for tackling the above approach would be much appreciated. Thanks again in advance.
Any ideas?
At the moment, using a 1px spacer image is your best option. I may implement this as a new feature.
Thanks for the reply. How do I get around this using the plugin when the images need the same name? It's for a large project so not easy to make up lots of spacer images of the same name. Ideally just using the one spacer gif for all.
Thanks again. It's a great plug in and just want to make sure I can continue to use it to work in this way too if possible.
In that case I'd take a look at https://github.com/tubalmartin/riloadr#feature-unpredictable so you can define a breakpoint to use one spacer gif for all of the images.