In this particular case I'd have chosen the map (JS Object) solution, with keys being the classNames, and values being the arrays (of [width, height]) structure. For example:
var fancyBoxSettings = {
edit: [900, 400],
friend: [700, 300],
some: [42, 42],
more: [420, 420]
};
... minimizing the duplicating code (all these width =, height =
, break
etc.). Then I would have managed retrieving of these values with a helper function:
function getFancyBoxDimensions(className) {
var dimensions = fancyBoxSettings[className] || ['auto', 'auto'];
return { width: dimensions[0], height: dimensions[1] };
}
So it can be used like this:
var fbxSettings = {
titlePosition : 'inside',
transitionIn : 'none',
transitionOut : 'none'
// ...
};
$.extend(fbxSettings, getFancyBoxDimensions(className));
$('.' + className).fancybox(fbxSettings);