Below is the function I am currently using:
function evaluateScroll(positions, width){
var scale = width / (width - Math.abs(positions[0]) - Math.abs(positions[1]));
var startLocation = positions[0] / width;
return [scale, startLocation];
}
This function is utilized in the following manner:
[tscale, tstartLocation] = evaluateScroll(scrollPositions, scrollPlotWidth);
While Safari and Firefox execute this code correctly, Chrome seems to stall at this particular line.
If I modify it to:
var holder = evaluateScroll(scrollPositions, scrollPlotWidth);
it functions properly, but then I must extract the indexes of holder
and assign them to the respective variables.
Why does Chrome have trouble with the array-style assignment? Is there a syntax that can be implemented which will work consistently across all browsers, without necessitating the use of the holder variable and reassigning values to the appropriate variables?