This problem is not related to wordpress but with how javascript behave.
You need to wait until ajax call is completed then relayout. You can confirm it by putting “console.log()” in your javascript.
This problem is not related to wordpress but with how javascript behave.
You need to wait until ajax call is completed then relayout. You can confirm it by putting “console.log()” in your javascript.