scroll to top vue
// add scroll to top when a is clicked (routes)
<a @click="scrollToTop(), goToPricing()">Pricing</a>
methods: {
scrollToTop() {
window.scrollTo(0, 0);
}, goToPricing() {
this.$router.push('/pricing');
}
} methods: {
scrollToTop() {
window.scrollTo(0,0);
}
}
<router-link @click.native="$scrollToTop">
Also in JavaScript:
- javascript change select options dynamically
- urlencoded json express
- shorthand if statement js
- How to append to a file in Node?
- javascript while loop
- jquery: get selected option of the drop down list
- cascading dropdown for forms react
- react convert excel to json
- javascript input value change
- comment in vue js
- check if something is a letter in js
- postgresql json array contains
- reactjs web3 components
- javascript ... operator
- convert int to float in javascript
- javascript sort array by object property
- is game development with javscript wrth it ?
- import jquery google cdn
- Write the JavaScript code to set the width of element to 50%;
- remove whitespace with regex javascript
- angularjs
- js start with
- fixed header on scroll vuejs
- moment js date diff