Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// wrap images with class of portrait into a group for styling
$(function(){
var cWrap=$('<div class="portrait-set clear"></div>');
$('.articleImages figure.portrait').each(function(){
var o = $(this).next('figure.portrait').length;
$(this).replaceWith(cWrap).appendTo(cWrap);
if (!o) cWrap=$('<div class="portrait-set clear"></div>');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment