Reload scripts during AJAX page load #25877
rossib94
announced in
Developers Community
Replies: 2 comments
-
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
+1, needed as well |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are trying to add page transitions using the https://swup.js.org/ library.
This all works great and we've got a nice transition that covers the page and then slides away again when the new content is loaded. However, because the pages now load via AJAX, the scripts that makes the Elementor entrance animations and background videos work doesn't get initiated. I can see that the video URL just isn't applied to the
The first time I go to the page it works fine, if I then navigate away and come back it no longer works as I think the scripts have already been initiated and they don't realise the page has been loaded again.
Swup has a plugin that allows us to force reload scripts when a new page is shown and this does make the video and entrance animations work but it also causes issues with other scripts.
What I think might work is to dequeue the Elementor scripts that make the entrance animations and background videos work. Then enqueue them again but set these to be reloaded. However, I need to know the name of all scripts Elementor needs to make this content work...
If you have a better idea then be sure to let me know.
Staging site: https://urbnmedstaging.wpengine.com/
Beta Was this translation helpful? Give feedback.
All reactions