|
233 | 233 | }
|
234 | 234 |
|
235 | 235 | this.$mirror.css({
|
236 |
| - transform: 'translate3d(0px, 0px, 0px)', |
| 236 | + transform: 'translate3d('+this.mirrorLeft+'px, '+(this.mirrorTop - overScroll)+'px, 0px)', |
237 | 237 | visibility: this.visibility,
|
238 |
| - top: this.mirrorTop - overScroll, |
239 |
| - left: this.mirrorLeft, |
240 | 238 | height: this.boxHeight,
|
241 | 239 | width: this.boxWidth
|
242 | 240 | });
|
243 | 241 |
|
244 | 242 | this.$slider.css({
|
245 |
| - transform: 'translate3d(0px, 0px, 0px)', |
| 243 | + transform: 'translate3d('+this.offsetLeft+'px, '+this.offsetTop+'px, 0px)', |
246 | 244 | position: 'absolute',
|
247 |
| - top: this.offsetTop, |
248 |
| - left: this.offsetLeft, |
249 | 245 | height: this.imageHeight,
|
250 | 246 | width: this.imageWidth,
|
251 | 247 | maxWidth: 'none'
|
|
271 | 267 | setup: function() {
|
272 | 268 | if (this.isReady) return;
|
273 | 269 |
|
| 270 | + this.lastRequestAnimationFrame = null; |
| 271 | + |
274 | 272 | var $doc = $(document), $win = $(window);
|
275 | 273 |
|
276 | 274 | var loadDimensions = function() {
|
|
320 | 318 |
|
321 | 319 | render: function() {
|
322 | 320 | this.isFresh || this.refresh();
|
323 |
| - $.each(this.sliders, function(){ this.render() }); |
| 321 | + $.each(this.sliders, function(){ this.render(); }); |
324 | 322 | },
|
325 | 323 |
|
326 | 324 | requestRender: function() {
|
327 | 325 | var self = this;
|
| 326 | + window.cancelAnimationFrame(self.lastRequestAnimationFrame); |
328 | 327 |
|
329 |
| - if (!this.isBusy) { |
330 |
| - this.isBusy = true; |
331 |
| - window.requestAnimationFrame(function() { |
332 |
| - self.render(); |
333 |
| - self.isBusy = false; |
334 |
| - }); |
335 |
| - } |
| 328 | + self.lastRequestAnimationFrame = window.requestAnimationFrame(function() { |
| 329 | + self.render(); |
| 330 | + self.isBusy = false; |
| 331 | + }); |
336 | 332 | },
|
337 | 333 | destroy: function(el){
|
338 | 334 | var i,
|
|
0 commit comments