mySelector = new pergola.Selector("My Selector");
mySelector.build({
parent : g,
list : [
"Small",
"Medium",
"Large",
"Extra large"
],
index : 0,
caption : {
text : {
x : -9,
y : 15,
textNode : "Size",
'letter-spacing' : 1,
kerning : 0,
"pointer-events" : "none"
}
},
target : tshirt,
fn : function () {
var t = this.target,
text = t.text,
i = this.index;
t.shape.setAttributeNS(null, "transform", "scale(" + (i + 1) + ")");
text.setAttributeNS(null, "font-size", (5 * (i + 1)) + "px");
text.setAttributeNS(null, "x", 18.5 * (i + 1));
text.setAttributeNS(null, "y", 14 * (i + 1));
text.setAttributeNS(null, "text-anchor", "middle");
}
});