Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/chenxuan0000/vue-seamless-scroll

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/chenxuan0000/vue-seamless-scroll

  • v1.1.12
  • Source
  • Go
  • Socket score

Version published
Created
Source

vue-seamless-scroll

A simple, Seamless scrolling for Vue.js

Build Status LICENSE MIT

🐾online demo | 🌾 sample demo | 📘 中文文档

Content

Browser support

IE
IE
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS
Chrome for Android
Android
IE9+

Features

  • base on requestAnimationFrame
  • the configuration meets a variety of requirements.
  • current support for seamless scrolling, single-step scrolling, and manual switching support for horizontal direction.
  • ongoing maintenance

Installation

NPM

npm install vue-seamless-scroll --save

CDN

https://cdn.jsdelivr.net/npm/vue-seamless-scroll@1.1.10/dist/vue-seamless-scroll.min.js

Usage

ES6

online demo

// **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
<script>
  import vueSeamless from 'vue-seamless-scroll'
   export default {
      components: {
        vueSeamless
      }
   }
</script>

Normal use

Example:

Specific reference test/test.html

<html>
<head>
  ...
</head>
<body>
  <div id="app">
    <vue-seamless-scroll></vue-seamless-scroll>
  </div>
  <script src="vue.js"></script>
  <script src="vue-seamless-scroll"></script>
  <script>
    new Vue({
      el: '#app'
    })
  </script>
</body>
</html>

Configure

keydescriptiondefaultval
stepthe faster the rolling speed is faster1Number
limitMoveNumstart seamless scrolling minimum data length5Number
hoverStopmouse hover control is enabledtrueBoolean
direction0 down、 1 up 、 2 left 、 3 right1Number
openTouchopen mobile touchtrueBoolean
singleHeightone single stop height(default zero is seamless) => direction 0/10Number
singleWidthone single stop width(default zero is seamless) => direction 2/30Number
waitTimeone single data stop wait time(ms)1000Number
switchOffsetthe left and right buttons distance from the left and right sides (px)30Number
autoPlaywhether or not to automatically play the switch needs to be set to falsetrueBoolean
switchSingleStepthe size of a single step switch (px)134Number
switchDelaythe animation time of a single step switch(ms)400Number
switchDisabledClassthe className of the switch parent element that cannot be clickeddisabledString
isSingleRemUnitsingleHeight and singleWidth Whether to enable the rem metricfalseBoolean

Individual special configuration items

1.The outermost container needs to be set manuallywidth 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)

3.The step value is not recommended to be too small, otherwise there will be carton effect.

4.You need to set when you need to manually switch left and right to scrollautoPlay: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.

Changelog

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.

License

vue-seamless-scroll is open source and released under the MIT License.

FAQs

Package last updated on 21 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc