Created
May 21, 2019 06:13
-
-
Save DevShahidul/6a68209895245e7f37cdee44e4cc23c6 to your computer and use it in GitHub Desktop.
See the example here >>> https://www.readcereal.com/wp-content/themes/cereal/js/main.singlePost.js?ver=1.0 and live demo here >>> https://www.readcereal.com/fort-of-the-sun/
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
// 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