【发布时间】:2015-07-02 11:23:02
【问题描述】:
你能告诉我如何在 angular 中切换行。换句话说,我制作了一个简单的 angular 可折叠行示例项目,当用户单击与 Accordion 中相同的行时,它会展开。所以我的问题是当我点击第一行时它打开或展开第三行为什么?只有第一行会扩展..我们可以添加一些衬里过渡,它看起来像向上滑动和向下滑动的方式。
点击第一行它展开第三行为什么?
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic Swipe Down</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<script src="http://code.ionicframework.com/contrib/ionic-contrib-swipecards/ionic.swipecards.js?v=5"></script>
<script src="script.js"></script>
</head>
<style>
.bg {
background: lightgray;
position: relative;
}
.ptag {
position: absolute;
top:0;
left:0;
width: 7%;
border: 1px solid red;
height: 100%;
background: lightblue;
color: white;
}
.circle{
width: 50px;
height: 50px;
float: right;
border-radius: 100%;
background: green;
margin-top: -7%;
line-height: 50px;
text-align: center;
color:black!important;
}
</style>
<body ng-app="app">
<div ng-controller="apptes">
<div class="list card">
<div class="item item-avatar bg" ng-click="clickrow()" ng-repeat="n in obj">
<p class="ptag">P</p>
<h2>{{n.number}}</h2>
<p>{{n.name}}</p>
<p class="circle">650</p>
</div>
<div ng-show="toogle_item">
<div class="item item-body" >
<p>
This is a "Facebook" styled Card. The header is created from a Thumbnail List item,
the content is from a card-body consisting of an image and paragraph text. The footer
consists of tabs, icons aligned left, within the card-footer.
</p>
<p>
<a href="#" class="subdued">1 Like</a>
<a href="#" class="subdued">5 Comments</a>
</p>
</div>
<div class="item tabs tabs-secondary tabs-icon-left">
<a class="tab-item" href="#">
<i class="icon ion-thumbsup"></i>
Like
</a>
<a class="tab-item" href="#">
<i class="icon ion-chatbox"></i>
Comment
</a>
<a class="tab-item" href="#">
<i class="icon ion-share"></i>
Share
</a>
</div>
</div>
</div>
</div>
</body>
</html>
我们可以添加上滑并以慢动作滑动吗?
【问题讨论】:
标签: angularjs angularjs-directive angularjs-scope angularjs-ng-repeat ionic-framework