Page 1 of 1
Mask/tooltip ?
Posted: Sat Oct 11, 2014 10:10 pm
by davidvo1
Hi, is it possible to add alt text (aka hover text or tooltip) to objects? The idea being that if you hover over an object and/or its label you would get a little bit more explanation of the purpose of that object. Thank you !
Re: Mask/tooltip ?
Posted: Sun Oct 12, 2014 1:08 pm
by massiws
davidvo1,
you can insert a simple jQuery function in
Setup -> System Setup -> Header, before the
</script> tab; this will load your function on each form:
Code: Select all
/**
* Show tooltip on object hover.
*
* @param {string} id Object ID
* @param {string} message Message to show on object hover
* @param {boolean} labelHover TRUE = show message also on label hover
*/
function showTooltip(id, message, labelHover) {
var label = $("#title_" + id);
var objName = label.text();
// Customize you message
message = objName + "\n\n" + message;
// Show tooltip on object hover
$("#" + id).hover(function() {
$(this).attr("title", message);
});
if (labelHover === true) {
// Show tooltip on label hover
label.hover(function() {
$(this).attr("title", message);
});
}
}
Now, on your form ->
Custom code -> Javascript tab you can insert this code:
Code: Select all
function nuLoadEdit() {
showTooltip("my_object_name1", "This is my first object tooltip!", true);
showTooltip("my_object_name2", "This is my second object tooltip!", false);
}
Hope this helps,
Max
Re: Mask/tooltip ?
Posted: Mon Jul 06, 2015 4:09 pm
by Tinka
Thank you, massiws,
This is very handy to make our forms more user-friendly.
AIthough I removed the label as part of the message.
BR, Tinka
Re: Mask/tooltip ?
Posted: Mon Jul 13, 2015 8:15 am
by admin
.