miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 298 forks source link

How to recreate the structure or refresh the gallery or part of its one section if we rotate one image ? #347

Open MrShaikh1357 opened 3 years ago

MrShaikh1357 commented 3 years ago

Suppose if we have many sections in my gallery. and in one section if I rotate one image to 90 degree than its new width and height will change accordingly. so how to recreate or refresh the single section with updated width height of that image.

in the below attached image, if you will see i have rotated image to 90 degree so its width & height have changed but i dont know how to refresh only that section. ( the updated image should have been rectangle )

Also would like to tell you every section is associated with jg-section justified-gallery and its unique id.

Thanks if advance for helping !

Untitled

MrShaikh1357 commented 3 years ago

Is there any update on this ?

jefftucker1952 commented 3 years ago

This is just basic Javascript, isn't it? If you have altered one of the images under program control, you just need to destroy JG for that div id:

$('#section1').justifiedGallery('destroy');

Then trigger the code that created it again:

$('#section1').justifiedGallery({
    rowHeight: 280,
    maxRowHeight: 450,
    lastRow: 'nojustify',
    margins : 8
});

Of course, if you've changed the orientation of one image manually, you can just hit CTRL-F5 and refresh the page!