msikma / pokesprite

Database project of box and inventory sprites from the Pokémon core series games
https://msikma.github.io/pokesprite/
MIT License
958 stars 164 forks source link

Sprites Not Showing #48

Closed Screemm closed 5 years ago

Screemm commented 5 years ago

For some reason, I'm unable to display any sprite on my site. I'm using the Laravel framework and followed all the steps in the readme. Sorry if this is something simple. Both files below are included in dex.blade.php.

My meta.blade.php file: meta blade php

My dex.blade.php file: dex blade php

My footer.blade.php file: footer blade php

msikma commented 5 years ago

Hey there, the issue is that PkSpr.process_dom() does not wait for the document to finish loading. You must manually hook it to the load event to make it wait (I'm not sure how Laravel works, but e.g. in jQuery you can do this with a $(function() { /* here */ });

Otherwise you could simply add the PkSpr.process_dom() line to the bottom of the document, after all the spans with icons have already been sent to the browser. Let me know if that works.

Screemm commented 5 years ago

Cool, looks like I just had to move the PkSpr.process_dom() down a line in the footer. All fixed. Cheers.

msikma commented 5 years ago

Oh wait, right, I misread the source of the footer file completely...

Glad you got it working 🙂