In jQuery you can pass key-value pairs like this
$(this).colorbox({ width:100, height:500 });
I’m wondering if there is a way to build such key-value pair, eg. something like this
var pairs = ???;
if(someCondition)
pairs.Add('width', '100');
else
pairs.Add('maxWidth', '200');
$(this).colorbox(pairs);
You create an object, then assign your values under your keys.