Home › Forums › JavaScript › JQuery's action go to start when I reload the page › Reply To: JQuery's action go to start when I reload the page
June 23, 2017 at 12:46 am
#256043
Participant
I guess I would make the click function a separate function which you can call from the click event as well as the document ready event.
The click event passes the right item by clicking on the item. Document ready passes the right item by searching for your active-trail
class, or just get the first item.
The result would then be something like this: https://codepen.io/jeroenreijs/pen/rwzLwo