You can decide to use vintageJS as a jQuery plugin, as an AngularJS module or implement the vanilla version without any dependencies.
- with jQuery
-
<script src="//code.jquery.com/jquery-2.0.0.min.js"></script> <script src="jquery.vintage.js"></script> <script> var options = { onError: function() { alert('ERROR'); } }; var effect = { vignette: 0.6, sepia: true }; $('img#yourImage').vintage(options, effect); </script>
- without dependencies (vanilla)
-
<script src="vintage.js"></script> <script> var img = document.getElementById('yourImage'); var options = { onError: function() { alert('ERROR'); } }; var effect = { vignette: 0.6, sepia: true }; new VintageJS(img, options, effect); </script>
- AngularJS
-
<img vintage="option:value;option:value;.." src="picture.jpg" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="angular.vintage.js"></script> <script> var app = angular.module('app',['vintagejs']); </script>