Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Teddy-Zhu/vue-smoothscroll

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 13, 2016 15:41
July 7, 2018 19:05
July 9, 2018 08:36

vue-smoothscroll

it's a vuejs version of smoothscroll Based on https://github.com/alicelieutier/smoothScroll/blob/master/smoothscroll.js

How to Use

# install dependencies
npm install vue-smoothscroll

then in the js file , you can use with router or others

var vueSmoothScroll = require('vue-smoothscroll');
Vue.use(vueSmoothScroll);
   //define a tag
   <div v-smoothscroll="{ duration : 500, callback: callback , context : undefined , axis :'y' }" class="message">
       message
   </div>

or

    this.$SmoothScroll(target,duration,callback,context,axis);

params

  • target is a HTMLElement Object from your document that you want to scroll to, or a numeric position on the page
  • duration is the total duration of the scroll (optional, defaults to 500ms)
  • callback is a function to be executed when the scrolling is over (optional)
  • context is the scrolling context (optional, defaults to window, can be any HTMLElement Object)
  • axis is the x,y axis ,the value can be 'y' , 'x' , 'both', 'y' means horizontal direction, 'x' means vertical direction

About

a vue version smoothscroll for website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published