|
|
|
@@ -154,7 +154,7 @@ var Rotation3D = window.Rotation3D = function (_opts) { |
|
|
|
* y y起点 + (尺寸 * 正弦 * y压缩) - 元素宽度一半 |
|
|
|
*/ |
|
|
|
Rotation3D.prototype.itemStyle = function($item, index, rotation) { |
|
|
|
console.log("itemStyle=" + rotation + " index=" + index); |
|
|
|
//console.log("itemStyle=" + rotation + " index=" + index); |
|
|
|
var parseSXY = circleMath.parseSXY(rotation, this); |
|
|
|
var scale = parseSXY.scale; |
|
|
|
var x = parseSXY.x; |
|
|
|
@@ -219,7 +219,7 @@ Rotation3D.prototype.itemStyle = function($item, index, rotation) { |
|
|
|
*/ |
|
|
|
Rotation3D.prototype.lineStyle = function($line, index, rotation) { |
|
|
|
var rotate = circleMath.parseRotate(rotation, this) |
|
|
|
console.log("lineStyle=" + rotation + " index=" + index); |
|
|
|
//console.log("lineStyle=" + rotation + " index=" + index); |
|
|
|
|
|
|
|
$line.css({ |
|
|
|
transform: 'rotate(' + rotate + 'deg)', |
|
|
|
@@ -235,7 +235,7 @@ Rotation3D.prototype.lineStyle = function($line, index, rotation) { |
|
|
|
Rotation3D.prototype.goTo = function (index) { |
|
|
|
var self = this; |
|
|
|
this.currenIndex = index; |
|
|
|
console.log('goTo currenIndex', index); |
|
|
|
//console.log('goTo currenIndex', index); |
|
|
|
/** |
|
|
|
* 1.计算floatIndex,用于控死amdiff |
|
|
|
*/ |
|
|
|
@@ -319,7 +319,7 @@ Rotation3D.prototype.onAutoPlay = function () { |
|
|
|
if (self.currenIndex < 0) { |
|
|
|
self.currenIndex = self.length - 1 |
|
|
|
} |
|
|
|
console.log("autoPlayTimer...."); |
|
|
|
//console.log("autoPlayTimer...."); |
|
|
|
self.goTo(self.currenIndex); |
|
|
|
self.currenIndex--; //倒叙 |
|
|
|
}, this.autoPlayDelay) |
|
|
|
@@ -331,12 +331,12 @@ Rotation3D.prototype.onAutoPlay = function () { |
|
|
|
Rotation3D.prototype.onDrag = function () { |
|
|
|
var self = this; |
|
|
|
var startX, startY, moveX, moveY, endX, endY; |
|
|
|
console.log("onDrag...."); |
|
|
|
//console.log("onDrag...."); |
|
|
|
// 拖拽:三个事件-按下 移动 抬起 |
|
|
|
//按下 |
|
|
|
this.$rotation.mousedown(function (e) { |
|
|
|
startX = e.pageX; startY = e.pageY; |
|
|
|
console.log("mousedown...."); |
|
|
|
//console.log("mousedown...."); |
|
|
|
// 移动 |
|
|
|
$(document).mousemove(function (e) { |
|
|
|
// console.log('移动'); |
|
|
|
@@ -348,10 +348,10 @@ Rotation3D.prototype.onDrag = function () { |
|
|
|
$(document).mouseup(function (e) { |
|
|
|
endX = e.pageX; endY = e.pageY; |
|
|
|
moveX = endX - startX; moveY = endY - startY; |
|
|
|
console.log("mouseup...."); |
|
|
|
//console.log("mouseup...."); |
|
|
|
// 每40旋转一步 |
|
|
|
var moveIndex = parseInt(Math.abs(moveX) / 50) |
|
|
|
console.log('moveIndex',moveIndex) |
|
|
|
//console.log('moveIndex',moveIndex) |
|
|
|
if (moveIndex > 0) { |
|
|
|
// console.log(moveX<0 ? '向左' : '向右') |
|
|
|
if (moveX < 0) { //向左 |
|
|
|
|