GithubHelp home page GithubHelp logo

lpender / swipelist.js Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 696 KB

Responsive wrapper for iDangerous Swiper, which sets the number of slides per view based on width requirements.

Home Page: www.fatcity.us/swipelist.js/example/

License: MIT License

JavaScript 99.99% CSS 0.01%

swipelist.js's Introduction

swipelist.js

About

URL: https://github.com/lpender/swipelist.js

Author: lpender

Swipelist is a responsive plugin for the iDangerous Swiper.

It operates on the principle that, when designing responsively, it is desirable to keep slide width constant. The number of slides within a "view" should vary to keep the width of each slide as nearly constant as possible.

As such, you configure it, not by setting the number of slides per view, but my setting a range for the desired widths of the slides.

For example, setting slideRange to [120,140], will cause the swiper to add a slide when the width of each slide goes above 140, or to remove a slide, when it goes below 120.

If swipelist cannot set the slide width within in that range, it will round up.

See the example

Run grunt serve to see the example! (/example/index.html)

Usage:

Requires jQuery and iDangerous Swiper.

Inlcude the swipelist.js file afterwards, and initialize swiper with param:

swipelist:true

i.e.

You can set the min/max slide-width with the slideRange param.

It is recommended that use use calculateHeight: true.

new Swiper('.swiper-container', {
  swipelist:true,
  calculateHeight: true,
  slideRange : [300,310]
});

More coming soon...

Build from source

In order to build your generated AMD module from its source, you will also need Grunt. To install Grunt globally on the command line (and run the above build task), run:

npm install -g grunt-cli

Once you have generated your AMD module skeleton, you can build the minified files, the documentation and the example with Grunt:

grunt build

You can also launch the grunt serve task to load the "example" folder in your browser and benefit from livereload of the page in the browser once you edit one of your source file or one of the example files:

grunt serve

Built with Grunt

Credits

swipelist.js was initiated with generator-amd, a Yeoman generator that builds an AMD module boilerplate.

This project uses the following as development dependencies:

License

License

swipelist.js's People

Contributors

lpender avatar

Stargazers

Fabien Franzen avatar  avatar Andy Aylward avatar

Watchers

James Cloos avatar  avatar  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.