A simple AngularJS directive to use jQuery backstretch plugin (http://srobbin.com/jquery-plugins/backstretch/)
Install angular-backstrectch via bower: bower install angular-backstretch
-
Include
angular-backstretch.js
in your project -
Add it as a dependency of your main module:
angular.module('app', ['ngBackstretch'])
-
Create an object in your controller with the desired configuration. For example:
$scope.backstretch = { options: { fade: 750, duration: 3000, bodyBackground: true }, images: [ "img/bg_1.png", "img/bg_2.png", "img/bg_3.png" ] };
-
Declare an HTML element using the directive:
<my-backstretch configuration="backstretch"></my-backstretch>
Version 0.1.0