Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

Update /refresh/bind links dynamically created with javascript #107

Closed DonPedroo closed 3 years ago

DonPedroo commented 3 years ago

Hello,

Really digging this library, i have an issue with dynamic links generated on the page, I have a javascript gallery/slider and each slide has a link to other pages, so when I was testing it out I had hardcoded link URL but when I progressed with my app I am injecting links dynamically with javascript, but then highway transitions do not work and I see links attributes are empty, so it is clear links are not registered.

Is there a way to call highway to rescan page for the links? I found one closed issue where it was recommended to call bind method but it is not clear how exactly to call it and where to find it.

Thank you.

ThaoD5 commented 3 years ago

Please, see the attach method. You can ask Highway to listen to the given array of new links.