I am trying to set bunch of default properties for multiple instances of qtip, but it is not working. is it possible or am I doing something wrong?
Common Properties
var qtipDefaults = {
show: 'mouseover',
hide: 'mouseout',
position: {
corner: {
target: 'bottomLeft',
tooltip: 'topLeft'
}
},
style: {
name: 'dark'
}
};
Instantiation # 1
$('#sbt_name').qtip({
content: 'This is the Name of the Course'
}).extend(qtipDefaults);
Instantiation # 2
var sbt_name = $('#sbt_name').qtip({
content: 'This is the Name of the Course'
});
$.extend(sbt_name, qtipDefaults);
You must prepare qtip parameters before calling qtip plugin. Try this:
$('#sbt_name').qtip($.extend(true, {}, qtipDefaults, {
content: 'This is the Name of the Course'
}));
$.extend() merges two or more objects. true parameter indicates it will make deep copy. First object is empty, for keeping original qtipDefaults unchanged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With