Code Monkey home page Code Monkey logo

slip.js's Introduction

slip.js

移动端跟随手指滑动组件,零依赖。

文档

文档

源码

源码用CoffeeScript书写,查看源码

下载

min.slip.js

示例

手机访问:

搜狐视频客户端完美适配iOS8

搜狐视频客户端完美适配iOS8

匆匆那年

匆匆那年

安装

使用 bower 安装

$ bower install slip.binnng.js --save

更新版本

$ bower update

使用 Yeoman 安装

$ npm install -g generator-webapp-slip
$ yo webapp-slip

快速上手

一个全屏可滑动的宣传网页:

var ele = document.getElementById("slip");

// 垂直滑动
Slip(ele, "y").webapp();

// 水平滑动
// Slip(ele, "x").webapp();

一个可滑动的高度为200px的轮播器:

var ele = document.getElementById("slip");

Slip(ele, "x").slider()
  .height(200);

一个可滑动的元素,开始滑动,滑动中,结束滑动都有自己的定制:

  var ele = document.getElementById("slip");
  var mySlip = Slip(ele, "xy");

  mySlip
    .start(function(event) {
      console.log('start');

      // 事件对象
      console.log(event);
      // 当前坐标值
      console.log(this.coord);
    })
    .move(function(event) {
      console.log('move');
    })
    .end(function() {
      console.log('end');
      console.log(this.coord);

      // 滑动方向
      console.log(this.orient);
    });

slip.js's People

Contributors

binnng avatar jamiesoung avatar hashplus avatar

Stargazers

Roman 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.