Git Product home page Git Product logo

vue-fullpage's Introduction

vue-fullpage

基于vue的fullpage.js

功能概述

可实现移动端的单页滚动效果,支持横向滚动和纵向滚动

兼容性

目前还未进行大规模兼容性测试。有bug请提问至issues

安装

npm install vue-fullpage --save

文档

api文档

快速上手

main.js

在main.js需要引入该插件的css和js文件 在使用VueFullpage时配置自定义参数

import 'vue-fullpage/vue-fullpage.css'
import VueFullpage from 'vue-fullpage'
Vue.use(VueFullpage, {
  start: 0,
  dir: 'v',
  duration: 500,
  beforeChange: function (prev, next) {
  },
  afterChange: function (prev, next) {
  }
})

app.vue

模板部分:page-wp容器上加v-page指令

<div class="fullpage-container">
  <div class="fullpage-wp" v-fullpage>
    <div class="page-1 page">
      <p class="part-1" v-animate="'fadeInLeft'">VueFullpage</p>
    </div>
    <div class="page-2 page">
      <p class="part-2" v-animate="'fadeInRight'">VueFullpage</p>
    </div>
    <div class="page-3 page">
      <p class="part-3" v-animate="'fadeInTop'">VueFullpage</p>
    </div>
  </div>
</div>

css部分: page-container需要固定宽度和高度,fullpage会自适应父元素的宽度和高度。
如下设置可使滚动页面充满全屏

<style>
.page-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
</style>

demo

源码:https://github.com/wendaosanshou/vue-fullpage/tree/master/demo/vue-fullpage-demo

地址:

请使用chrome的手机模拟器或手机浏览器访问

http://vue.wendaosanshou.top/vue_fullpage_demo/

感谢

代码参考 颜海镜 大神的项目:zepto.fullpage.js

vue-fullpage's People

Contributors

taomas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.