Giter Site home page Giter Site logo

jdscolam / ng-backstretch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rprovost/ng-backstretch

0.0 1.0 0.0 147 KB

A native Angular directive derived from the jQuery Backstretch plugin (http://srobbin.com/jquery-plugins/backstretch)

License: MIT License

JavaScript 100.00%

ng-backstretch's Introduction

ng-backstretch

A native Angular directive derived from the jQuery Backstretch plugin (http://srobbin.com/jquery-plugins/backstretch)

Installation

Download the project with Bower:

bower install ng-backstretch

Include ng-backstretch in your project:

<script src="bower_components/ng-backstretch/dist/ng-backstretch.min.js"></script>

Inject the ng-backstretch module into your Angular project:

angular.module('myApp', ['ng-backstretch']);

Usage

Add the required attributes to any DOM element.

A single image:

<div backstretch backstretch-images="'http://placehold.it/1600x1600'"></div>

An array of images:

angular.module('myAPP')
.controller('myController', function($scope){
  $scope.images = [
    'http://dl.dropbox.com/u/515046/www/garfield-interior.jpg',
    'http://dl.dropbox.com/u/515046/www/outside.jpg',
    'http://dl.dropbox.com/u/515046/www/cheers.jpg'
  ];
});
<div backstretch backstretch-images="images"></div>

Slideshow Attributes

A slideshow duration and fade period can be specified through additional directive attributes.

<div backstretch backstretch-images="images" backstretch-duration="5000" backstretch-fade="1"></div>  

backstretch-duration is specified in milliseconds and defaults to 5000 if none is specified. backstretch-fade is specified in seconds and defaults to 1 if none is specified.

ng-backstretch's People

Contributors

rprovost avatar jdscolam avatar schrags08 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.