Justified-Gallery icon indicating copy to clipboard operation
Justified-Gallery copied to clipboard

First page refresh causes wrong image positions

Open bartosz-malec opened this issue 9 years ago • 7 comments

I have a problem with grid on first page load. After first page load or hard refresh (ctrl + F5), grid looks bad, and images has incorrectly calculated widths (width of images is 100%). After normal page refresh everything back to narmal and images has good positions and sizes.

Have you ever met this problem?

bartosz-malec avatar Feb 21 '16 19:02 bartosz-malec

First photo with width 100% test1 Second photo after refresh the page test2

bartosz-malec avatar Feb 21 '16 19:02 bartosz-malec

Yes it happened one time... can you send me a link to this page? Or with the mail the html with the images (saving the page with the browser)? Thank you

miromannino avatar Feb 21 '16 19:02 miromannino

I sent an email to you with access credentials.

bartosz-malec avatar Feb 21 '16 19:02 bartosz-malec

I resolved this problem. I run justifiedGalleryCode in $("document").ready(function() { $("document").load(function() { [justifiedGalleryCode] }); });

bartosz-malec avatar Feb 22 '16 11:02 bartosz-malec

@bartosz-malec what is that justifiedGalleryCode?

Sebastiansc avatar Nov 09 '16 08:11 Sebastiansc

@bartosz-malec I'm facing a similar issue where the widths are 100% in all cases, could you please tell us what your JustifiedGalleryCode is?

voletiv avatar Jan 16 '17 06:01 voletiv

var isDomReady = false;
var isWinLoad = false;

$(document).ready(function() {
    isDomReady = true;
    initJustifiedGallery();
});

$(window).load(function() {
    isWinLoad = true;
    initJustifiedGallery();
});

function initJustifiedGallery()
{
if (isWinLoad === true && isDomReady === true) {
   $('.gallery').justifiedGallery({
                rowHeight: 180,
                lastRow: 'nojustify',
                margins: 6,
                selector: 'div'
            });
}
}
```

And no more double refresh. it's work 

danygit avatar Oct 04 '17 11:10 danygit