Note that there are some explanatory texts on larger screens.

plurals
  1. POMutliple imagesLoaded functions css call issue
    primarykey
    data
    text
    <p>My preloader doesnt show when I have two function using Imagesloaded. Works fine when I disable imagesloaded on one. Need to have ablity to use three or four depending.</p> <p>My preloader div and SCSS. </p> <pre><code>&lt;div class="masonry-loading"&gt; &lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/library/images/ajax-loader.gif" /&gt; &lt;/div&gt; .masonry-loading {padding:10% 0 10% 50%;} img {border:0 !important;} </code></pre> <p>Here is my function for different columns. </p> <pre><code>// Masonary $(document).ready(function() { var $container = $('.masonry-c'); var min_width = 230; $('.masonry-c').hide(); $container.imagesLoaded(function() { $('.masonry-c').fadeIn('fast'); $("div.masonry-loading").css({ 'display': 'none' }); $container.masonry({ itemSelector: '.masonry-box', isAnimated: true, columnWidth: function (containerWidth) { var box_width = (((containerWidth) / 3) | 0); if (box_width &lt; min_width) { box_width = (((containerWidth) / 2) | 0); } $('.masonry-box').width(box_width); return box_width; } }); }); }); // Masonary $(document).ready(function() { var $container1 = $('.masonry-four-c'); var min_width = 200; $('.masonry-four-c').hide(); $container1.imagesLoaded(function() { $('.masonry-four-c').fadeIn('fast'); $container1.masonry({ itemSelector: '.masonry-four-box', isAnimated: true, columnWidth: function (containerWidth) { var box_width = (((containerWidth) / 4) | 0); if (box_width &lt; min_width) { box_width = (((containerWidth) / 3) | 0); } if (box_width &lt; min_width) { box_width = (((containerWidth) / 2) | 0); } $('.masonry-four-box').width(box_width); return box_width; } }); }); }); </code></pre> <p>Below I placed the CSS to remove loader, for some reason this does not work when I load it in the function above after imagesLoaded. Perhaps if I could get that work, it would solve the problem. </p> <pre><code>function triggerCallback() { callback.call($this, $images), $("div.masonry-loading").css({'display': 'none'}); } </code></pre> <p>Tried a bunch of stuff, I bet it something simple. Anyway help would be greatly appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload