SHOW:
|
|
- or go back to the newest paste.
1 | jQuery(document).ready(function($) { | |
2 | - | //add popup functionality to all image links |
2 | + | $('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"]').each(function(){ |
3 | - | $('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"]').magnificPopup({type:'image'}); |
3 | + | //single image popup |
4 | - | //initialize for wordpress galleries |
4 | + | if ($(this).parents('.gallery').length == 0) { |
5 | - | $('.gallery').magnificPopup({ |
5 | + | $(this).magnificPopup({type:'image'}); |
6 | - | delegate: 'a', |
6 | + | |
7 | - | type: 'image', |
7 | + | |
8 | - | gallery: { |
8 | + | //gallery popup |
9 | - | enabled: true |
9 | + | $('.gallery').each(function() { |
10 | $(this).magnificPopup({ | |
11 | delegate: 'a', | |
12 | type: 'image', | |
13 | gallery: {enabled:true} | |
14 | }); | |
15 | }); | |
16 | }); |