The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Lazy CSS breaks JS plugin

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #194110

    Hey guys, need some help figuring out a bug in my website, this is my first forum post about it.

    So for the first time I lazy-loaded my CSS into my site below the fold. This works great except it breaks one JS plugin on mobile only, not sure why this is the case. In the portfolio section, all the images are squished very small – the CSS is not being applied and I am not sure why. Thanks for any help!

    My site:
    The plugin:


    There are a lot of things that could be causing the break.

    My recommendation would be to reduce the complexity of your problem. Start by taking away lazyCSS, if that doesn’t work, peel back another part until it’s working again.

    Once it’s working again, you could set up a CodePen and make that your reduced test case (see tips). With your simple baseline, you can then start to mess around on CodePen by adding scripts back in and see what breaks it.

    Once you know what breaks it, and you still can’t figure it out, let us know as someone might have experience with this or see something obvious you’ve overlooked.


    The problem was when I moved the script ordering around it was initializing the the plugin before the CSS was loaded which made the plugin calculate the offset values for the squares incorrectly. I made sure to load the CSS before initializing the isotope plugin and that fixed the problem.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.