Closed mmjr closed 10 years ago
Could you setup an example on http://jsfiddle.net?
Just a quick explanation: the div with class jcarousel has a css transform of: -webkit-transform: matrix(2, 0, 0, 2, 0, 0);
what I have been able to see is that the calculation of the left property on the ul when sliding is not taking in account the scale factor.
Digging in the Jcarousel code, under the _scroll function. I have divided the pos variable which sets the left property by the scale factor. This seems to fix the issue. However, when reloading the carousel(I am loading images dynamically) it seems to brake ths navigation again.
_scroll: function(item, animate, callback) { if (this.animating) { if ($.isFunction(callback)) { callback.call(this, false); }
return this;
}
if (typeof item !== 'object') {
item = this.items().eq(item);
} else if (typeof item.jquery === 'undefined') {
item = $(item);
}
if (item.length === 0) {
if ($.isFunction(callback)) {
callback.call(this, false);
}
return this;
}
this.inTail = false;
this._prepare(item);
var pos = this._position(item),
currPos = this.list().position()[this.lt];
if (pos === currPos) {
if ($.isFunction(callback)) {
callback.call(this, false);
}
return this;
}
var properties = {};
var matrixRegex = /matrix\((-?\d*\.?\d+),\s*0,\s*0,\s*(-?\d*\.?\d+),\s*0,\s*0\)/,
matches = $(this.element()).css('-webkit-transform').match(matrixRegex) || $($(this.element().parent())).css('-webkit-transform').match(matrixRegex) || [];
pos *= (1/matches[1]);
properties[this.lt] = pos + 'px';
this._animate(properties, animate, callback);
return this;
},
I thought you were talking about the browser zoom. Not sure it's worth to fully support this since i'd consider this an edge case. I will keep it on my todo-list and will dig into this if i find time.
Ok, sorry to hear that. we need support for all css transitions and transforms.
Ill have a go at fixing it myself...
Thanks for responding though
It would be great if you could support scale of container.
Right now the scale works but the scrolling moves several slides each time instead of one.
Thanks