Giter Site home page Giter Site logo

angular-carousel's Introduction

Angular-carousel

An adaptive carousel based on angularJS directive.

alt tag

Installation

You can install directive via bower

$ bower install angular-es-carousel

Add dependences to your html file

<script src="/bower_components/angular-es-carousel/js/esCarousel.js"></script>
<link rel="stylesheet" href="/bower_components/angular-es-carousel/css/carousel.css"/>

Don't forget add 'carousel' module to your angular dependences.

angular.module('appName', ['carousel']);

Usage

Carousel has three display modes that are specified by element attribute es-carousel.

  • es-carousel="3" - display three card in front
  • es-carousel="5" - display five card in front
  • es-carousel="7" - display seven card in front

Inner html of node element with attribute es-card will be used as a template for card. The function that will set for attribute card-action on the same element will be used as action when you click on the card.

Usage with unique html templates for each cards

    <div es-carousel="7">
        <div es-card card-action="someActionFromScope(someParam)">
             <!-- template for first card -->
        </div>

        <div es-card card-action="otherActionFromScope(someParam)">
            <!-- template for second card -->
        </div>
       <!-- ... templates for the next cards -->
    </div>

Usage with html template cloned via ng-repeat directive

    <div es-carousel="7">
        <div ng-repeat="card in cardsArrayFromScope" es-card="card" card-action="card.action()" last-card="$last">
            <span>{{card.title}}</span>
            <img class="image image-1" ng-src={{card.image}} alt={{card.alt}}/>
        </div>
    </div>

Also you can mix repeated cards with unique templated

    <div es-carousel="7">
        <div ng-repeat="card in cardsArrayFromScope" es-card="card" card-action="card.action()" last-card="$last">
            <span>{{card.title}}</span>
            <img class="image image-1" ng-src={{card.image}} alt={{card.alt}}/>
        </div>
        
        <div es-card card-action="someActionFromScope(someParam)">
            <!-- some template for next card -->
        </div>
    </div>

angular-carousel's People

Contributors

eugenesnihovsky avatar

Watchers

 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.