I use the jQuery Masonry library for the gallery. However, there is the centering of the first element top:0; left:0; top:0; left:0; If you put it in the center, then all other photos will go the same. How to write a check for js / jQuery, if div 1 (one), then use for it styles that align it in the center?
<div style="position:relative; min-width:80%; clear:both; height:auto; margin:0 auto; padding-top:2%;padding-bottom:16%;"> <div class="grid"> <div class="grid-sizer"></div> <div class="grid-item marg_center"> <a class="example-image-link" href="http://timworld.info/wp-content/uploads/2016/05/Bauhaus_in_Tel_Aviv_7_120x80.jpg" data-lightbox="example-set" > <img class="example-image" src="http://timworld.info/wp-content/uploads/2016/05/Bauhaus_in_Tel_Aviv_7_120x80.jpg" alt=""/> </a> </div> </div> </div>
if ($('div.grid').length == 1) { сделать что то }? :) - Vasily Barbashev