Giter VIP home page Giter VIP logo

angular-shapeshift's Introduction

angular-shapeshift

A simple AngularJS directive for ShapeShift.js.

How To Use

  • Install the angular-shapeshift bower package
$ bower install angular-shapeshift
  • Add angular-shapeshift as a dependency to your angular module:
angular.module("myAngularModule", ["angular-shapeshift"]);
  • Define your images within your angular controller:
$scope.images = [ "img1", "img2", "img3" ];
  • Add references to angular-shapeshift.min.js and angular-shapeshift.min.css:
<script src="public/lib/angular-shapeshift/dist/angular-shapeshift.min.js"></script>
<link href="public/lib/angular-shapeshift/dist/angular-shapeshift.min.css" rel="stylesheet" type="text/css" />
  • Add a shapeshift element to your html. Just give it a list of image sources and (optionally) specify a column width:
<shapeshift images="images" columnWidth="150"/>

[See example] (https://jsfiddle.net/smythey21/de5tecp3/19/) on JSFiddle. ShapeShift can be found [here] (https://github.com/McPants/jquery.shapeshift).

Gotchas

This directive will not work if placed within modal components, as the image positions need to be determined when angular parses the directive.

Need More Shapeshift Options?

Its possible you'll want to change some of the default settings defined in the [shapeshift directive] (https://github.com/smythey21/angular-shapeshift/blob/master/app/directives/shapeshift.js). If so, just place this [shapeshift directive] (https://github.com/smythey21/angular-shapeshift/blob/master/app/directives/shapeshift.js) into your Angular app and customize as needed.

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.