tianyi wrote:1.When fist time opening website and go into subdirectories, some of the photos in this gallery will stick together.
Apparently, this bug happens only with 1) Sidebar layout, 2) Windows (scrollbars), and 3) When navigating from a page without scrollbars (for example your home page) to a justified-gallery page with scrollbars. I will look into a proper fix for this bug in next X3 release. In the meantime, I have two "hacks" for you:
1. Simple solution, is to set body overflow-y: scroll. This will cause the scrollbar area to always remain visible, also on the home page. Not elegant, but it prevents the bug when navigating to the gallery. Go to Settings > Custom > Custom CSS, add the following:
body {
overflow-y: scroll;
}
2. More complicated solution, is to force browser window resize event, after the gallery renders. This is not elegant either, because it causes a reflow of the gallery after it's loaded. But it does fix the layout. Go to Settings > Custom > Javascript, and add the following:
var resize_observer = false;
function kill_resize_observer(){
if(!resize_observer) return;
resize_observer.disconnect();
resize_observer = false;
}
function x3_load_page(){
if('ResizeObserver' in window && typeof(Event) === 'function' && document.documentElement.classList.contains('root-scrollbar')){
kill_resize_observer();
var justified = document.getElementsByClassName('layout-justified');
if(justified.length){
var jwidth = justified[0].clientWidth;
resize_observer = new ResizeObserver(function(){
if(jwidth !== justified[0].clientWidth) window.dispatchEvent(new Event('resize'));
kill_resize_observer();
});
resize_observer.observe(justified[0]);
}
}
}
I would probably recommend option 1.