Have your say in Community Polls: What was/is your greatest motivation to start your own business?

In dawn theme some brand images does not load until I refresh the page

Solved

In dawn theme some brand images does not load until I refresh the page

ankkax
Tourist
8 0 3

Hi I have problem with dawn theme where some of the brand images does not load until I refresh the page after the initial load, I've tried to different browsers and I use private window to do the testing.

I found this from shopify reddit for DAWN theme to put in base.css, but it didn't work.

 

.js .product__media { width: 100% !important; }
 
 
Accepted Solution (1)
nardoayala
Shopify Partner
28 6 9

This is an accepted solution.

There's something in your code adding an inline style to all brand images that makes their max-width zero

chrome_0nqRnPkYG8.jpg

Sometimes it sets the value to zero and other times to 150px. It's hard to asses what could be causing it, for how it behaves, I think there's some JavaScript code that's relying in an event listener that sometimes is triggered before the piece of code is loaded.

If you want a hotfix, you could set the max width manually with this CSS rule:

.hc-brands-item img {
  max-width: 150px !important;
}

I'm not a huge fan of the above as we're not understanding what's going on, but it might do the trick while you figure it out.

View solution in original post

Replies 4 (4)

nardoayala
Shopify Partner
28 6 9

Hello 🙂

Could you please share your store URL and some steps to replicate the issue?

ankkax
Tourist
8 0 3

Hi sure, https://hyotyvoima.fi/ when you load home page first time brand images does not load, but after your refresh the page with F5 images loads. also when you go to "Tuotekatalogi" and select "selaa tuotteita" only half of the brands loads under Aurinkopaneelit until you refresh the page with F5.

nardoayala
Shopify Partner
28 6 9

This is an accepted solution.

There's something in your code adding an inline style to all brand images that makes their max-width zero

chrome_0nqRnPkYG8.jpg

Sometimes it sets the value to zero and other times to 150px. It's hard to asses what could be causing it, for how it behaves, I think there's some JavaScript code that's relying in an event listener that sometimes is triggered before the piece of code is loaded.

If you want a hotfix, you could set the max width manually with this CSS rule:

.hc-brands-item img {
  max-width: 150px !important;
}

I'm not a huge fan of the above as we're not understanding what's going on, but it might do the trick while you figure it out.

ankkax
Tourist
8 0 3

alright, I'll go with that for now. I'll try to figure out what is wrong there. Thank you for your help!