I need help implementing a fade effect for an icon in the middle of a picture that indicates scrollability to the user. Currently, when the user scrolls, I can hide the icon but would like to add a nice smooth fade-out effect.
Here is the HTML code snippet:
<div style="overflow: scroll;">
<img id="fullImage" ng-src="{{imageUrl}}" imageonload>
<img id="drag-arrows" class="drag-arrows" ng-src="images/icon-drag.png"/>
<h3 id="optionName" class="optionName">{{ optionName }}</h3>
<a class="close-reveal-modal" ng-click="cancel()"><img class="cancel-icon" ng-src="images/icon-close-fullscreen.png"></a>
</div>
Below is my directive that currently hides the drag arrows icon on touchmove event:
modalController.directive('imageonload', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('load', function() {
// Code to resize and fit the image within viewport
});
element.bind('touchmove', function(){
// Icon fade-out effect implementation needed here
});
}
};
});
If anyone has suggestions on how to achieve this fade effect using AngularJS, please share!