Team:Freiburg/Templates/html/js.html
From 2014.igem.org
(Difference between revisions)
Line 47: | Line 47: | ||
$(this).magnificPopup({ | $(this).magnificPopup({ | ||
delegate: 'a', | delegate: 'a', | ||
+ | type: 'image', | ||
+ | tLoading: 'Loading image #%curr%...', | ||
+ | mainClass: 'mfp-img-mobile', | ||
+ | gallery: { | ||
+ | enabled: true, | ||
+ | navigateByImgClick: true, | ||
+ | preload: [0,1] // Will preload 0 - before current, and 1 after the current image | ||
+ | }, | ||
+ | image: { | ||
+ | tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', | ||
+ | titleSrc: function(item) { | ||
+ | var caption = $(item.el).find('.caption-fullscreen').html(); | ||
+ | return caption?caption:''; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $('figure img').each(function(){ | ||
+ | var parent = this.parentNode; | ||
+ | if (parent.tagName != 'A') return; | ||
+ | $(parent).magnificPopup({ | ||
type: 'image', | type: 'image', | ||
tLoading: 'Loading image #%curr%...', | tLoading: 'Loading image #%curr%...', |
Revision as of 19:38, 8 October 2014