Esempio n. 1
0
File: pan.js Progetto: 1Jamie/gaia
 _set: function(x) {
   x = clamp(x, this._minX, this._maxX);
   this.targets.forEach(el => {
     el.style.transform = 'translateX(' + x +'px)';
   });
   this._curX = x;
 },
Esempio n. 2
0
File: pan.js Progetto: 1Jamie/gaia
  _updateDestination: function(x, duration) {
    duration = duration != null ? duration : this.TRANSITION_DURATION;

    this._startX = this._curX;
    this._destX = clamp(x, this._minX, this._maxX);

    var now = Date.now();
    this._endTime = now + duration;

    if (!this._requestId) {
      this._startTime = now;
      this._tween();
    }
  },