Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用引导模式和角度ui获得css幻灯片转换?_Javascript_Css_Angularjs_Twitter Bootstrap - Fatal编程技术网

Javascript 如何使用引导模式和角度ui获得css幻灯片转换?

Javascript 如何使用引导模式和角度ui获得css幻灯片转换?,javascript,css,angularjs,twitter-bootstrap,Javascript,Css,Angularjs,Twitter Bootstrap,我试图在引导模式中获得幻灯片动画,使用angular ui和angular animate,我试图制作一个向导,但是我似乎无法使动画工作 这是我的引导模式的代码: <div class="modal-header"> <h3>New Template Wizard</h3> </div> <p>{{step}}</p> <div ng-switch on="step"> <div class="slid

我试图在引导模式中获得幻灯片动画,使用angular ui和angular animate,我试图制作一个向导,但是我似乎无法使动画工作

这是我的引导模式的代码:

<div class="modal-header">
<h3>New Template Wizard</h3>
</div>

<p>{{step}}</p>

<div ng-switch on="step">
<div class="slide" ng-switch-when="1">
    <div class="list-group">
        <a ng-click="stepUp()" class="list-group-item">
            <h4 class="list-group-item-heading"><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;New Thing Template</h4>
            <p class="list-group-item-text">A thing is a collection of devices</p>
        </a>
        <a href="#" class="list-group-item">
            <h4 class="list-group-item-heading"><span class="glyphicon glyphicon-off"></span>&nbsp;New Device Template</h4>
            <p class="list-group-item-text">A device is a collection of sensors (channels)</p>
        </a>
    </div>
</div>
<div class="slide" ng-switch-when="2">
    <p>STEP 2 of wizard</p>
</div>

这不起作用,有什么建议吗?

我找到了答案,结果发现css是错误的(我想),无论如何,这是最终的html和css,它起作用了

html:

希望它能帮助别人

.slide.ng-enter, .slide.ng-leave {
-webkit-transition: 575ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all;
-moz-transition: 575ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all;
-ms-transition: 575ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all;
-o-transition: 575ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all;
transition: 575ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all;
}

.slide.ng-enter { 
left: 100%;
}
.slide.ng-enter-active {
left: 0;
}
.slide.ng-leave {
left: 0;
}
.slide.ng-leave-active {
left: -100%;
}
<div ng-switch="step" class="my-switch-container">
<div class="my-switch-animation" ng-switch-when="1">
    <div class="list-group">
        <a ng-click="stepUp()" class="list-group-item">
            <h4 class="list-group-item-heading"><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;New Thing Template</h4>
            <p class="list-group-item-text">A thing is a collection of devices</p>
        </a>
        <a href="#" class="list-group-item">
            <h4 class="list-group-item-heading"><span class="glyphicon glyphicon-off"></span>&nbsp;New Device Template</h4>
            <p class="list-group-item-text">A device is a collection of sensors (channels)</p>
        </a>
    </div>
</div>
<div class="my-switch-animation" ng-switch-when="2">
    <p>STEP 2 of wizard</p>
</div>
.my-switch-container {
  position:relative;
  height:200px;
}

.my-switch-animation.ng-enter,
.my-switch-animation.ng-leave {
  -webkit-transition:0.5s linear all;
  transition:0.5s linear all;
  height:200px;

  position:absolute;
  top:0;
  left:0;
  right:0;
}

.my-switch-animation.ng-enter {
  left:50%;
}

.my-switch-animation.ng-leave,
.my-switch-animation.ng-enter.ng-enter-active {
  left:0;
}

.my-switch-animation.ng-leave.ng-leave-active {

  left:50%;
}