I am in the process of developing a drop-down menu that can be clicked. Using my custom AngularJS directive, I have successfully implemented functionality to load menu items dynamically.
While I have made significant progress, I have encountered a small issue.. I am unable to find a CSS(3) only solution for creating an animation when the ul
dropdown occurs.
This is what I currently have:
https://i.sstatic.net/6x6Xw.gif
The code snippet for the dropdown function:
private CreateDirective(): any {
return {
restirct: 'E',
scope: {
dataset: '='
},
templateUrl: 'App/Templates/LeftBar/index.html',
controller: function ($scope) {
$scope.Select = Select;
var SelectedItem;
function Select(MenuItem: any): any {
if (SelectedItem != null) {
SelectedItem.selected = false;
}
if (MenuItem.open) {
MenuItem.selected = true;
MenuItem.open = false;
return;
}
if (MenuItem.childs && MenuItem.childs.length > 0) {
MenuItem.open = true;
}
MenuItem.selected = true;
SelectedItem = MenuItem;
}
}
}
}
Is there a way to achieve a similar effect to jQuery's slideToggle
within my directive?
Thank you for your assistance!