Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Open last picture


I'm looking for a way to remember and automatically open the last picture on a new visit to an image gallery.
So let's say I close the lightbox while picture no. 11 of a series was enlarged in Fresco. Then I close my browser and I open the gallery again the next day. Is it possible to start again where I left the day before?
The page refreshes after closing Fresco by the way.

This is the code I use in a PHP loop:


Thank you


  • You could build something that updates the browser history and modifies the url/hash of the page at the same time. Update the hash with some kind of marker like "fresco-groupname-imagenr". Then read the hash when the page opens with javascript and if it contains the fresco marker, use the API to open the corresponding image. You could use the callbacks to hook into updates within Fresco. That's how you'd build history tracking in a lightbox, just javascript.

    Fresco does not modify the browser history and page url, because I think linking the two creates a bad user experience. Clicking through for example 10 images pollutes the browser history with 10 urls that you have to go back through whenever you want to modify the actual page history. To go back a page you'll now have to click the back button 11 times instead of 1. The history of what you've clicked through in a lightbox is more like a sub history of events, it should never be exposed to the actual browser history for UX reasons.

    So I recommend not messing with browser history and whenever someone lands on a page they've been on before, even if they had a lightbox open, always just show the page itself.

  • Hi Nick

    And what does the position indicator exactly do?

  • It shows the position of the image you're viewing within its group.

  • Can I open an image based on a position number using the html approach?
    And if so: how can I do this?

  • edited January 2017

    You'll need the API for that:$('#elementid')[0]);

    That'll open a link that uses the html approach by id.

Sign In or Register to comment.