Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Mask/tooltip ?
-
- Posts: 1
- Joined: Sat Oct 11, 2014 10:06 pm
Mask/tooltip ?
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 !
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Mask/tooltip ?
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:
Now, on your form -> Custom code -> Javascript tab you can insert this code:
Hope this helps,
Max
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);
});
}
}
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);
}
Max
-
- Posts: 73
- Joined: Mon Feb 24, 2014 2:58 pm
Re: Mask/tooltip ?
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
This is very handy to make our forms more user-friendly.
AIthough I removed the label as part of the message.
BR, Tinka