[jQuery] [tooltip]: Multiple tooltips running from one set of parameters

[jQuery] [tooltip]: Multiple tooltips running from one set of parameters


I'm sure this question has a simple answer, it's just stumping me...
I have multiple (about 15) tooltips based on your "Fancy" and "Pretty"
demos that are attached to a series of HTML labels.
All the tooltips use the same parameters:
    track: true,
    delay: 0,
    showURL: false,
    showBody: " - ",
    fixPNG: true,
    left: 30,
    top: -100,
Its only the "extraClass:" that differs.
How can i reduce code by stating the tooltip parameters just once for
all tooltips, and then change the extraClass per tooltip?
So the final code looks something like this:
$(function() {
$('.tooltip01, .tooltip02, .tooltip03').tooltip({
    track: true,
    delay: 0,
    showURL: false,
    showBody: " - ",
    fixPNG: true,
    left: 30,
    top: -100
});
$('.tooltip01').tooltip({     extraClass: "tooltip01_css" });
$('.tooltip02').tooltip({     extraClass: "tooltip02_css" });
$('.tooltip03').tooltip({     extraClass: "tooltip03_css" });
});





























    • Topic Participants

    • rob