Tagged: Masonary-width not controllable
Hi,
I want to use a Masonary-gallery, but I didn’t get it work properly.
It crashes the layout, even if I pack it into a color-section or column: it spreads out over the whole viewport-width and pushes my sidebar underneath. How to solve this keeping my (right) sidebar?
Thanks
Tim
Doesn’t work:
CSS:
#top .av-masonry-gallery-container {
width: 100% !important;
max-width: 100% !important;
margin: 0 auto !important;
}
#top .container {
overflow: hidden;
}
#top .av-content-slide-container .av-masonry-gallery-container {
width: 100% !important;
}
/* Mobile Fix */
@media only screen and (max-width: 767px) {
.responsive #top #wrap_all .container .av-masonry-gallery-container {
padding-left: 0 !important;
padding-right: 0 !important;
}
}
JS:
// Force Masonry Gallery zu container width
function fix_masonry_gallery_width() { ?>
<script>
jQuery(document).ready(function($) {
$('.av-masonry-gallery-container').css({
'width': '100%',
'max-width': '100%',
'margin': '0 auto'
});
});
</script>
<?php }
add_action('wp_footer', 'fix_masonry_gallery_width');
