Use with Laravel Livewire, Swup, Turbolinks and BarbaJS #79
aerni
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
I released an improved version of this script as a package: https://github.com/aerni/alpine-statamic-responsive-images |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I released an improved version of this script as a package: https://github.com/aerni/alpine-statamic-responsive-images
If you use this addon in conjunction with Laravel Livewire or a pjax library like Swup, Turbolinks or BarbaJS, your images won't load on subsequent requests. This is due to the observer script only being executed on the first request. You can get around this issue with a simple Alpine plugin. Simply replace the stock script with the script below.
In your
responsiveImage.blade.php
view:Beta Was this translation helpful? Give feedback.
All reactions