How would one scroll to an element in a webpage using javascript?
I want to basically create the same thing that happens when using <a href="#link"></a> but in javascript using a function. I do not want to use any jQuery, I'm currently using VueJS with the Vuetify framework. My navigation looks like this:
<v-navigation-drawer
persistent
:mini-variant="miniVariant"
:clipped="clipped"
v-model="drawer"
enable-resize-watcher
fixed
app
>
<v-list>
<v-list-tile
value="true"
v-for="(item, i) in items"
:key="i"
@click="navigate(item.link)"
>
<v-list-tile-action>
<v-icon>{{ item.icon }}</v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list>
</v-navigation-drawer>
As you can see, I have a @click property already set up, but I have no idea how to actually scroll to an ID link like #info or #contact
scrollTo