在 360player.js 中调用了一个函数:我的第 701 行。寻找:
this.mmh = function(e) {
这里 deltaX 变量的计算不正确,很可能是由于轮播创建的偏移量。我通过从 deltaX 变量中减去相同的偏移量来解决我页面上的问题。这是带有伪代码的新函数来修改它:
this.mmh = function(e) {
/**
* Here you need to find the offset from the left of the page
* and assign it to a variable. In your case, it is simply the window's
* width multiplied by 2.
*/
offSet = 2 * $(window).width();
if (typeof e === 'undefined') {
e = window.event;
}
var oSound = self.lastTouchedSound,
coords = self.getMouseXY(e),
x = coords[0],
y = coords[1],
/* here you subtract your offset and scrubbing should work again */
deltaX = x-(oSound._360data.canvasMidXY[0]-offSet),
deltaY = y-oSound._360data.canvasMidXY[1],
angle = Math.floor(fullCircle-(self.rad2deg(Math.atan2(deltaX,deltaY))+180));
oSound.setPosition(oSound.durationEstimate*(angle/fullCircle));
self.stopEvent(e);
return false;
};