Coder Social home page Coder Social logo

angular-carousel's Introduction

AngularJS Touch Carousel

A carousel implementation for AngularJS ng-repeats, optimised for mobile devices.

Demo : http://revolunet.github.io/angular-carousel

Comments and contributions welcome :)

Proudly brought to you by the @revolunet team.

Usage :

  1. Add angular-carousel.js and angular-mobile.js (from this repo) to your code.
<link href="lib/angular-carousel.css" rel="stylesheet" type="text/css" />
<script src="lib/angular.js"></script>
<script src="lib/angular-mobile.js"></script>
<script src="lib/angular-carousel.js"></script>
  1. Add a dependency to angular-carousel module in your application.
angular.module('MyApp', ['angular-carousel']);
  1. Add a rn-carousel attribute to your <ul> block and your <li>'s become magically swipable ;)
<h3>Discover sports</h3>
<ul rn-carousel class="image">
  <li ng-repeat="image in sportImages" style="background-image:url({{ image }});">
    <div class="layer">{{ image }}</div>
  </li>
</ul>

Features :

  • Mobile friendly, tested on webkit+firefox
  • CSS 3D transformations with GPU accel
  • rn-carousel-index two way binding to control the carousel position, see demo page.
  • rn-carousel-indicator to turn on the indicator, see demo page.
  • rn-carousel-buffered to buffer the carousel, good if you have many or unlimited items inside.
  • rn-carousel-cycle to have an forever-cycling carousel.
  • rn-carousel-next="getNextSlide(item)" : callback called when carousel reach the last slide, that should return a single slide. great for generating slides on-demand.
  • rn-carousel-prev="getPrevSlide(item)" : callback called when carousel reach the first slide, that should return a single slide. great for generating slides on-demand.

Todo :

  • moar tests :)
  • perfs improvements
  • optional auto-slide
  • buffering : allow buffer size tuning (default=3 slides)
  • buffering : add intelligent indicators

Inspirations

Licence

As AngularJS itself, this module is released under the permissive MIT license. Your contributions are always welcome.

angular-carousel's People

Contributors

0x-r4bbit avatar jeffbcross avatar revolunet avatar

Watchers

 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.