I’m working on setting a webkit filter on my ion-menu-content
pane by having it watch the $ionicSideMenusController
open ratio, similar to the fade-bar example. Now the issue I’m having is getting the value for the filter for brightness set to 100% initially then reduce that to 50% as the menu opens.
It seems like it should be pretty straight forward but I’m not sure what the issue is. Any ideas?
.directive('darken', function ($timeout) {
'use strict';
return {
restrict: 'A',
link: function ($scope, $element) {
$timeout(function () {
$scope.$watch('$ionicSideMenusController.getOpenRatio()', function (ratio) {
$element[0].style.webkitFilter = 'brightness(100%)' + Math.abs(ratio);
});
});
}
};
})