Page 420 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 420
$(_this.el).spSpeed(_this.speed);
}
}, 100);
};
/**
* @method stop
* Stops a slot
*/
Slot.prototype.stop = function() {
var _this = this,
limit = 30;
clearInterval(_this.si);
_this.si = window.setInterval(function() {
if(_this.speed > limit) {
_this.speed -= _this.step;
$(_this.el).spSpeed(_this.speed);
}
if(_this.speed <= limit) {
_this.finalPos(_this.el);
$(_this.el).spSpeed(0);
$(_this.el).spStop();
clearInterval(_this.si);
$(_this.el).removeClass('motion');
_this.speed = 0;
}
}, 100);
};
/**
* @method finalPos
* Finds the final position of the slot
*/
Slot.prototype.finalPos = function() {
var el = this.el,
el_id,
pos,
posMin = 2000000000,
best,
bgPos,
i,
j,
- 413 -