vue-seamless-scroll, can scroll by mouse
npm install vue-seamless-scroll-mouse
πΎonline demo |
πΎ sample demo |
π δΈζζζ‘£
- Update log
- Browser support
- Features
- Installation
- Usage
- ES6
- Normal use
- Configure
- Events
- Individual special configuration items
- Changelog
- Issues solution
- Cares
- Contribution
Configuration update
- Added navigation configuration, whether the left and right scrolling shows the controller button. When the value is true, autoPlay automatically becomes false.
IE |
Firefox |
Chrome |
Safari |
iOS |
Android |``bash`
npm install vue-seamless-scroll --save
Usage
$3
online demo
`js
// main.js
// 1.global install
import Vue from 'vue'
import scroll from 'vue-seamless-scroll'
Vue.use(scroll)//or you can set componentName default componentName is vue-seamless-scroll
Vue.use(scroll,{componentName: 'scroll-seamless'})
// 2.single .vue import
`$3
Example:
> Specific reference test/test.html
`html
...
`Configure
|key|description|default|val|
|:---|---|---|---|
|step|the faster the rolling speed is faster|1|Number|
|limitMoveNum|start seamless scrolling minimum data length|5|Number|
|hoverStop|mouse hover control is enabled|true|Boolean|
|direction| 0 downγ 1 up γ 2 left γ 3 right|1|Number|
|openTouch|open mobile touch |true|Boolean|
|singleHeight|one single stop height(default zero is seamless) => direction 0/1|0|Number|
|singleWidth|one single stop width(default zero is seamless) => direction 2/3|0|Number|
|waitTime|one single data stop wait time(ms)|1000|Number|
|switchOffset|the left and right buttons distance from the left and right sides (px)|30|Number|
|autoPlay|Less than 1.1.17 version needs to be set to false when manually switching|true|Boolean|
|switchSingleStep|the size of a single step switch (px)|134|Number|
|switchDelay|the animation time of a single step switch(ms)|400|Number|
|switchDisabledClass|the className of the switch parent element that cannot be clicked|disabled|String|
|isSingleRemUnit|singleHeight and singleWidth Whether to enable the rem metric|false|Boolean|
- update 1.1.17
|key|description|default|val|
|:---|---|---|---|
|
navigation|Whether the left and right scrolling shows the controller button, autoPlay automatically becomes false when true|false|Boolean|CalBackEvents
|name|description|calback params|
|:---|---|---|
|ScrollEnd|A roll-through callback event|null|Individual special configuration items
> 1.The outermost container needs to be set manually
width height overflow:hidden> 2.The left and right seamless rolling needs to be set for the main content area (that is, the default slot slots)
css width(otherwise, the actual width cannot be calculated correctly). You can also set it to display:flex; without setting the css width property.> 3.The step value is not recommended to be too small, otherwise there will be carton effect.(If single-step scrolling is set, the step needs to be a divisor of the single-step size, otherwise the position of the single-step scrolling end cannot be guaranteed to be accurate. ~~~~~, such as single step 30, step can not be 4)
> 4.You need to set when you need to manually switch left and right to scroll
autoPlay:false(Starting with version 1.1.17, you only need to set navigation:false),(The loop is not currently supported.)> 5.Provides
slot left-switch || right-switch you can freely define the button styles you want. The outer div is positioned in the middle,the distance from both sides can be adjusted by the switchOffset parameter.> 6.When the button reaches the boundary position, it automatically adds a definition to the state button that cannot be clicked.
switchDisabledClass: 'disabled',you can configure it as needed.Issues solution
> Event cannot be duplicatedChangelog
See the GitHub release history.Cares
If you want js to scroll seamlessly (without dependencies) you can switch to here.seamscrollγContribution
Welcome to give some Suggestions and optimizations, and look forward to your Pull Request`.