ticallian
asked on
Javascript: JQuery tooltip plugin - Multiple tooltips using one set of parameters
I'm using the Tooltip plugin for JQuery from www.bassistance.de, although i think the question just needs some javascript to be rearranged to fix my problem
I have multiple (about 15) image tooltips that are attached to a series of HTML labels.
All the tooltips use the same plugin parameters:
track: true,
delay: 0,
showURL: false,
showBody: " - ",
fixPNG: true,
left: 30,
top: -100,
Its only the "extraClass:" used to style and select which image is displayed 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" });
});
Thanks for any help
I have multiple (about 15) image tooltips that are attached to a series of HTML labels.
All the tooltips use the same plugin parameters:
track: true,
delay: 0,
showURL: false,
showBody: " - ",
fixPNG: true,
left: 30,
top: -100,
Its only the "extraClass:" used to style and select which image is displayed 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" });
});
Thanks for any help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER