我正在尝试实现这个动画
行话.html
<ion-view title="Jargon">
<ion-content>
<a class="item" href="#/jargon"></a>
<div class="container">
<div data-card="4" class="card"><span>Click Me</span></div>
<div data-card="3" class="card"><span>Click Me</span></div>
<div data-card="2" class="card"><span>Click Me</span></div>
<div data-card="1" class="card"><span>Click Me</span></div>
<div data-card="0" class="card"><span>Click Me</span></div>
</div>
</ion-content>
控制器:jargonController.js
angular.module('starter.jargonController', ['ionic'])
.controller('jargonCtrl', function (){
var rotate, timeline;
rotate = function() {
return $('.card:first-child').fadeOut(400, 'swing', function() {
return $('.card:first-child').appendTo('.container').hide();
}).fadeIn(400, 'swing');
};
timeline = setInterval(rotate, 1200);
$('.card').click(function() {
return rotate();
});
});
我收到此错误:
错误:$ 未定义 @ http://localhost:8100/js/controllers
ReferenceError: $ 未定义
正是这一行产生了错误:
return $('.card:first-child').fadeOut(400, 'swing', function() {
我错过了什么?
更新
虽然我确保在这里添加它:
.state('jargon', {
url: 'jargon',
templateUrl: 'templates/jargon.html',
controller: 'jargonCtrl',
css: 'css/jarg.css'