amort2000 Posted June 29, 2022 Share Posted June 29, 2022 Hi, I've got a button reversing a timeline, then following a link. My trouble is that the link is followed (so exiting the page) before the timeline finishes. What am I doing wrong here? Thanks peeps, function below: function menu_close(e) { e.preventDefault(); let link_destination = this.getAttribute("href"); tl_mobile_menu.reverse(); window.location.href = link_destination; } Link to comment Share on other sites More sharing options...
Solution akapowl Posted June 29, 2022 Solution Share Posted June 29, 2022 Hello @amort2000 In general, it is pretty tough to give solid advice without a minimal demo - but I think you'll just need to delay the change of the window.location.href - maybe put it in an onReverseComplete callback - similar to what was shown in the example in the thread linked below. If that doesn't help, a minimal demo of yours would be greatly appreciated. 1 Link to comment Share on other sites More sharing options...
amort2000 Posted June 29, 2022 Author Share Posted June 29, 2022 Thanks akapowl - onReverseComplete was the answer! Brilliant - thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now