I would like to know if there is anyway in JQuery to scroll to elements that are inside different divs. For example, if I go to example.com/programme#event-2, div on the left should scroll to element id="event-2", and div on the right should scroll to element id="event-2". Here's my HTML:
<div id="events">
<div id="event-list">
<div class="content">
<h2>Vendredi 17 octobre</h2>
<ul id="event-1" class="event-title">
list items
</ul>
<h2>Vendredi 21 octobre</h2>
<ul id="event-2" class="event-title">
list-items
</ul>
</div>
</div>
<div id="event-details">
<div class="content">
<section id="event-1" class="details">
stuff
</section>
<section id="event-2" class="details">
stuff
</section>
</div>
</div>
</div>
You can have a look at this Codepen, it will help visualize my problem. Thank you!