Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

location.hash on screenshots

  • Loading branch information...
commit 9840a9b859ea8762c7bd64d05f8c461ff182e630 1 parent 34fda5a
@peterbe authored
Showing with 23 additions and 8 deletions.
  1. +23 −8 templates/screenshots.html
View
31 templates/screenshots.html
@@ -50,17 +50,32 @@
})(jQuery);
$(function() {
- $('.shots a').each(function() {
- $.preLoadImages($(this).attr('href'));
- });
$('.shots a').fancybox({
- 'transitionIn': 'elastic',
- 'transitionOut': 'elastic',
- 'easingIn' : 'easeOutBack',
- 'easingOut' : 'easeInBack',
- 'titlePosition': 'inside'
+ 'transitionIn': 'elastic',
+ 'transitionOut': 'elastic',
+ 'easingIn' : 'easeOutBack',
+ 'easingOut' : 'easeInBack',
+ 'titlePosition': 'inside',
+ onComplete: function(element) {
+ var nth, href = $(element).attr('href');
+ $('.shots a').each(function(i, e) {
+ if ($(e).attr('href') == href) {
+ location.hash = '' + (i + 1);
+ }
+ });
+ }
+ });
+
+ $('.shots a').each(function(i) {
+ $.preLoadImages($(this).attr('href'));
+ if (location.hash) {
+ if ('#' + (i + 1) == location.hash) {
+ $(this).trigger('click');
+ }
+ }
});
+
});
</script>
{% end %}
Please sign in to comment.
Something went wrong with that request. Please try again.