Created
October 15, 2013 03:15
-
-
Save seafarer/6985992 to your computer and use it in GitHub Desktop.
Integrate magnific popup into wordpress via http://pastebin.com/s3rT3FBr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function($) { | |
| $('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"]').each(function(){ | |
| //single image popup | |
| if ($(this).parents('.gallery').length == 0) { | |
| $(this).magnificPopup({type:'image'}); | |
| } | |
| }); | |
| //gallery popup | |
| $('.gallery').each(function() { | |
| $(this).magnificPopup({ | |
| delegate: 'a', | |
| type: 'image', | |
| gallery: {enabled:true} | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment