scaron / prettyphoto

prettyPhoto is a jQuery based lightbox clone. Not only does it support images, it also add support for videos, flash, YouTube, iFrames. It’s a full blown media lightbox. The setup is easy and quick, plus the script is compatible in every major browser.
http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/
553 stars 281 forks source link

Revert to original hash when closing overlay #80

Open Mondane opened 12 years ago

Mondane commented 12 years ago

Now, when a prettyPhoto overlay closes, the hash is set to

!prettyPhoto

I would suggest to set the hash with the value it was before opening the overlay.

Ie. starting url is:

http://www.example.com/index.php#footer

Opening an overlay makes:

http://www.example.com/index.php/#!prettyPhoto/0/

Closing the overlay gives:

http://www.example.com/index.php#footer

In case of no original hash, to prevent the scroll bug, revert to

http://www.example.com/index.php#!prettyPhoto

(or -even better- a configurable string for !prettyPhoto).