-1

I'm using Galleria.js to create a background slideshow in a site I'm working on, and I'd like to be able to serve different resolutions to different devices. I'm using adaptive-images.php which is generating the needed files, but it seems as though galleria is still pulling the original full resolution ones no matter what. Is there a way to make this work, or perhaps an alternative solution like picturefill.js?

Thanks!

2 Answers2

0

I'd love to see this, too. Unfortunately this could only be done in Javascript - not in PHP. Probably it would be possible to use picturefill.js as a Galleria plugin but unfortunately I don't know enough Javascript to do this. Explanation: Galleria dynamically looks for the image referenced and shows that one. Something is needed to tell Galleria to use a different image source (depending on the screen size e.g.). To do this the method that picturefill.js uses (replacing src by srcset) would be perfect but it has to be integrated as a function in Galleria. It's probably not too hard for someone with a good knowledge of Javascript - anybody? This recently has also been asked at Galleria's support: http://support.galleria.io/discussions/questions/18040-compatible-with-picturefilljs

eventcom
  • 1
  • 1
0

However Galleria provides a somewhat useful functionality out of the box: You can use three different sizes of an image by serving markup like this:

<div class="galleria">
    <a href="/img/large1.jpg"><img src="/img/thumb1.jpg" data-big="/img/big1.jpg" data-title="My title" data-description="My description"></a>
    <a href="/img/large2.jpg"><img src="/img/thumb2.jpg" data-big="/img/big2.jpg" data-title="Another title" data-description="My description"></a>
</div>

The 'data-big' size will be shown in fullscreen mode out of the box - not depending on screen size. Perhaps it's a workaround until something more useful comes up. Everything truly adaptive needs a Javascript plugin for Galleria.

eventcom
  • 1
  • 1
  • That does seem pretty useful, but I'm also trying to integrate this into Wordpress whereas I could allow my client to upload images and have the galleria pick up a size appropriate responsive image – rossalot Aug 25 '14 at 21:53
  • There's a tutorial on galleria.io how to integrate Galleria into WP http://j.mp/1lvQ0wy. Furthermore there are a few WP plugins, too, but all of them require some additional work. I found those two helpful: Galleria http://j.mp/1lvQh2K and MarcTV Galleria http://j.mp/1lvQvGS – eventcom Aug 27 '14 at 13:06