All Projects → Desdesdesgo → vue-scrollwatch

Desdesdesgo / vue-scrollwatch

Licence: other
scrollspy

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-scrollwatch

react-is-scrolling
Simply detect if users are scrolling in your components in a declarative API
Stars: ✭ 17 (-71.19%)
Mutual labels:  scroll
react-shadow-scroll
Component that customizes the list and inserts shadow when scrolling exists
Stars: ✭ 28 (-52.54%)
Mutual labels:  scroll
vanillajs-scrollspy
ScrollSpy in pure JavaScript
Stars: ✭ 47 (-20.34%)
Mutual labels:  scroll
lua-watcher
👀 A Lua module to monitor files from a specific directory
Stars: ✭ 16 (-72.88%)
Mutual labels:  watcher
JhScrollActionSheetView
JhScrollActionSheetView - UIcollectionView横向滚动,类似微博新版的详情页分享界面,可设置单排或双排显示,title不设置不显示title,如果想实现发送站内用户的功能,自己可以改一下代码
Stars: ✭ 13 (-77.97%)
Mutual labels:  scroll
any-scroll
🚀 模拟scrollview, 支持pc/移动端, 让实现Tab/Slider等组件轻而易举.
Stars: ✭ 45 (-23.73%)
Mutual labels:  scroll
React Scroll Sync
Synced scroll position across multiple scrollable elements
Stars: ✭ 252 (+327.12%)
Mutual labels:  scroll
gowatch
watch go files for developer, support run test case and auto reload server application
Stars: ✭ 18 (-69.49%)
Mutual labels:  watcher
react-auto-scroll
Automatically scroll an element to the bottom
Stars: ✭ 28 (-52.54%)
Mutual labels:  scroll
github-actions-watcher
A CLI tool to see the status of your all GitHub Actions workflows in real time
Stars: ✭ 111 (+88.14%)
Mutual labels:  watcher
QuickTraceiOSLogger
A real time iOS log trace tool, view iOS log with pc web browser under local area network, which will automatically scroll like xcode. 一个实时的iOS日志跟踪工具,在局域网中使用 PC Web 浏览器查看 iOS 日志,它将像xcode一样自动滚动。
Stars: ✭ 16 (-72.88%)
Mutual labels:  scroll
RollingNotice-Swift
滚动公告、广告,支持灵活自定义cell。淘宝、口碑、京东、美团、天猫等等一切滚动广告 Roll Notice or Advertising, customize cell as UITableViewCell supported, Swift version is also ready
Stars: ✭ 109 (+84.75%)
Mutual labels:  scroll
h5-vue-scroller
inspired by iNoBounce, stop your iOS webapp from bouncing around when scrolling and more.
Stars: ✭ 30 (-49.15%)
Mutual labels:  scroll
myoddweb.directorywatcher
A fast and reliable, (non blocking!), .NET/C++ File/Directory watcher, complete rewrite of FileSystemWatcher to ensure speed/accuracy/reliability/suppress duplicate events.
Stars: ✭ 41 (-30.51%)
Mutual labels:  watcher
taskctl
Concurrent task runner, developer's routine tasks automation toolkit. Simple modern alternative to GNU Make 🧰
Stars: ✭ 237 (+301.69%)
Mutual labels:  watcher
Moveto
A lightweight scroll animation javascript library without any dependency
Stars: ✭ 2,746 (+4554.24%)
Mutual labels:  scroll
scroll-sync-react
A scroll syncing library for react that is up to date
Stars: ✭ 49 (-16.95%)
Mutual labels:  scroll
react-use-scroll-position
A react hook to use scroll position
Stars: ✭ 45 (-23.73%)
Mutual labels:  scroll
vuejs-loadmore
A pull-down refresh and pull-up loadmore scroll component for Vue.js. Vue上拉加载下拉刷新组件
Stars: ✭ 62 (+5.08%)
Mutual labels:  scroll
universalSmoothScroll
A cross-browser smooth-scrolling API which supports multiple and interruptable scroll-animations on all DOM's elements, even at the same time!
Stars: ✭ 46 (-22.03%)
Mutual labels:  scroll

vue-scrollwatch

scrollwatch features:

  • auto detect element enter viewport when scroll
  • expose api: scrollTo , to scroll element to enter viewport
  • you can set scroll container ,not just window
  • use vue directive
  • no limitation of nav list

特性:

  • 滚动时判断出窗口中当前元素
  • 暴露api scrollTo 自由指定要滚到的位置
  • 滚动容器自由指定,不局限于window
  • vue 指令的方式
  • 导航列表没有任何限制

click to demo

learning usage from src/views/page1.vue and page2.vue
查看源码中的src/views/page1.vue and page2.vue 获得详细使用方式

Installation

npm install --save vue-scrollwatch

in main.js

import vueScrollwatch from "vue-scrollwatch"
Vue.use(vueScrollwatch)

Usage

导航
nav

<ul>
    <li @click="scrollTo('a')">section 1</li>
    <li @click="scrollTo('b')">section 2</li>
    <li @click="scrollTo('c')">section 3</li>
    <li @click="scrollTo('d')">section 4</li>
</ul>

element to watch

 <div class="section" v-scrollWatch="{name:'a',offset:0,callback:spyDomChange}">scetcion 1</div>
<div class="section" v-scrollWatch="{name:'b',offset:0,callback:spyDomChange}">scetcion 2</div>
<div class="section" v-scrollWatch="{name:'c',offset:0,callback:spyDomChange}">scetcion 3</div>
<div class="section" v-scrollWatch="{name:'d',offset:0,callback:spyDomChange}">scetcion 4</div>

callback and scrollTo in methods

import scrollWatch from "vue-scrollwatch"
export default {
    ...
    methods:{
        spyDomChange(node) {
            if (this.activeMenu != node.name)
                this.activeMenu = node.name
        },
        scrollTo(name){
            scrollWatch.scrollTo(name)
        }
    }
    ...
}

if you want to define a container to scroll (not window)
如果你想指定滚动容器,而不是window

<div id="scrollDom">
    <div class="section" v-scrollWatch="{name:'a',offset:0,callback:spyDomChange}">scetcion 1</div>
    <div class="section" v-scrollWatch="{name:'b',offset:0,callback:spyDomChange}">scetcion 2</div>
    <div class="section" v-scrollWatch="{name:'c',offset:0,callback:spyDomChange}">scetcion 3</div>
    <div class="section" v-scrollWatch="{name:'d',offset:0,callback:spyDomChange}">scetcion 4</div>
<div>
import scrollWatch from "vue-scrollwatch"
export default {
    ...
    created(){
        scrollWatch.setContainer("#scrollDom")
    }
    ...
}

you also can use class as selector
你也可以使用 class 来作为css 选择器

container and element to be watch hasn't to be father and sons,it also can be grandfather or grand-grandfather
滚动容器和监听元素之间不一定是父子关系,可以是爷孙关系,也可以是祖宗孙子关系

Options

name

required: true

offset

元素位置偏移 default: 0

callback

type: function

dev example

 npm run dev

Thanks

vue-scrollactive

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].