consumerportal
Version:
mydna Custimised for you
24 lines (21 loc) • 724 B
text/typescript
/// <reference path="../includes.ts" />
/*
Usage:
<div parallax-scroller class="classwithBGimage">Your content here</div>
*/
declare let isIE: () => void;
((): void => {
'use strict';
function parallax(): angular.IDirective {
const htmlTag: JQuery = $('html');
return {
restrict: 'A',
link: (scope: angular.IScope, elm: angular.IAugmentedJQuery) => {
elm.RDParallax({
direction: (htmlTag.hasClass('smoothscroll') || htmlTag.hasClass('smoothscroll-all')) && !isIE() ? 'normal' : 'inverse'
});
}
};
}
angular.module('app').directive('parallaxScroller', parallax);
})();