【发布时间】:2017-12-01 17:30:52
【问题描述】:
我用 CSS 制作了自己的汉堡菜单。我想用 flexbox 解决它。所以我的 html/css 部分已经完成,看起来像这样:
angular.module("myApp", []).controller("myController", function($scope) {
$scope.animateHamburger = function() {
// ANIMATION
console.log("animate hamburger to cross and back to hamburger");
}
});
.cAnimatedExpander {
display: flex;
flex-direction: column;
justify-content: space-around;
height: 20px;
margin-right: 10px;
cursor: pointer;
}
.cAnimatedExpander span {
height: 2px;
width: 20px;
background-color: blue;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myController" class="cAnimatedExpander" ng-click="animateHamburger()">
<span></span>
<span></span>
<span></span>
</div>
所以现在我想要一个带有 css 的动画,就像这个例子(第一个 Slider):https://jonsuh.com/hamburgers/
我在互联网上找到了一些很好的教程,但我想在我的解决方案中使用没有 flexbox。希望得到一些帮助。
【问题讨论】:
-
我不明白,你在那个链接上有你需要的一切,只需解析他们的代码并使用你需要的部分
-
仅仅为了它而使用 Flexbox 并没有什么意义。我看不出你为什么要使用它。
标签: jquery html css angularjs flexbox