Reputation: 2748
I have this working for my qtip
/* required for qtip crests to crests */
var countyCrest = {
content: {
attr: 'id'
},
position: {
target: 'mouse',
adjust: {
mouse: true,
y: +10
}
},
style: {
classes: 'ui-tooltip-tipsy ui-tooltip-shadow',
tip: true
}
};/* end for qtip crests to crests */
and I would like to prepend "Co. " before each attr: 'id'. I tried various versions of
content: {
"Co. "+attr: 'id'
},
which does not work. Could anyone point me in the right direction? tia
Upvotes: 1
Views: 158
Reputation: 87073
Better would be like following:
var temp = {};
temp['Co. ' + attr] = 'id';
var countyCrest = {
content: temp,
...
}
String concatenation of Object
property as you tried is not possible.
content: {
attr: 'Co.id'
}
Upvotes: 1
Reputation: 51211
Besides the fact, that I can't see the attr
option for the content property (Documentation) (might be another version or whatever), i guess it should be:
content: {
attr: 'Co.'+'id'
},
(spaces are not allowed in id
attributes) instead of
content: {
"Co. "+attr: 'id'
},
since you don't want to alter the name of the option (which is fixed attr
) but the value of it.
Upvotes: 1