Created
July 16, 2014 14:00
-
-
Save addisonhall/05c2c4301cc35683fa1b to your computer and use it in GitHub Desktop.
Convert BC photo galleries into Fancybox lists
This file contains 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
// Convert BC photo galleries to lists | |
var $pg = $('.photogalleryTable'); | |
if ($pg.length) { | |
$pg.each(function(index){ | |
var $pgInner = $(this).html(); | |
$(this).replaceWith('<ul id="gallery-'+index+'" class="list-inline list-gallery product-gallery">' + $pgInner + '</ul>'); | |
var $newGallery = $('#gallery-'+index); | |
$newGallery.find('a').addClass('fancybox').removeAttr('onclick').attr('rel', 'group-'+index).wrap('<li>').find('img').addClass('img-responsive'); | |
$newGallery.css('visibility', 'visible').hide().fadeIn(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment