Skip to content

Instantly share code, notes, and snippets.

@DevShahidul
Created May 21, 2019 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevShahidul/6a68209895245e7f37cdee44e4cc23c6 to your computer and use it in GitHub Desktop.
Save DevShahidul/6a68209895245e7f37cdee44e4cc23c6 to your computer and use it in GitHub Desktop.
// 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