I am attempting to display a <div>
named settings when a button is clicked. The intention is for it to fade in and then slide towards the right side of the screen, originating from the left side.
Progress so far:
The HTML
<div id="settings" ng-show="settings">
</div>
and the link to execute the showSettings() function
:
<a href="#" ng-click="showSettings()"><i class="icon setting"></i></a>
The CSS
#settings {
background:red;
position:fixed;
top:0;
left:0;
bottom:0;
width:400px;
}
The Controller
$scope.showSettings = function(){
$timeout(function() {
$scope.settings = true;
}, 250);
}
Currently, I have achieved the fading effect, but how can I make the <div>
slide to the right by a specified distance, like 200px
?
Additionally, I would like the ability to click anywhere outside the <div>
itself to reverse the process.