11 Answers, 1 is accepted
The RadToolTip is designed to replace the standard browser tooltip and the standard tooltip shows when there is an alt property set and that is why this behavior when Autotooltipify is true is the correct one. You can achieve the desired behavior by adding the controls that you want to tooltipify to the RadToolTipManager's TargetControls collection instead of using the autotooltipify functionality as shown in our online demos below:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/overview/defaultcs.aspx
All the best,
Svetlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Is there a way to configure AutoTooltipify to skip alt tags on images, but tooltipify everything else?
Edit: well, using ToolTipZoneID can work in some situations..
Note, that as already explained one of the main purposes [among others] of RadToolTip is to be used as a replacement of the "standard browser tooltip". This is the reason that the tooltip, as its highest priority reads the title or alt attribute of the element (as it is the title/alt attribute that causes a browser tooltip to be displayed).
Since the tooltip manager used to work like above explained from its creation when autotooltipify is used, we got customers` requests to make this behavior consistent for populated TargetControls collection
and the same for the separate RadToolTip as well.
That is why even if you add the controls to the TargetControls collection, the Alt will be removed.
What I can suggest to do in order achieve what you need is to use some simple js code as the one shown below which I prepared for you:
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
script
type
=
"text/javascript"
>
function setToolTip()
{
var img = $get("<%=imgRating.ClientID %>");
var alt = img.getAttribute('alt');
var regTooltip = img.getAttribute('regulartooltip');
if(!alt || alt == '') img.setAttribute('alt', regTooltip);
}
</
script
>
<
img
src
=
"Sunset.jpg"
runat
=
"server"
onmouseover
=
"setToolTip();"
regulartooltip
=
"myStandardTooltip"
id
=
"imgRating"
alt
=
"Rate this Page"
width
=
"55"
height
=
"16"
/>
<
telerik:RadToolTip
runat
=
"server"
ID
=
"tipRating"
Title
=
"What do you think?"
Skin
=
"Office2007"
Animation
=
"None"
xManualClose
=
"true"
Sticky
=
"false"
ShowEvent
=
"OnMouseOver"
HideEvent
=
"LeaveTargetAndToolTip"
Width
=
"275"
Position
=
"BottomLeft"
RelativeTo
=
"Element"
OffsetX
=
"0"
OffsetY
=
"0"
TargetControlID
=
"imgRating"
IsClientID
=
"false"
>
Enter an optional comment with your rating:
<
textarea
id
=
"tbRatingComment"
rows
=
"3"
cols
=
"30"
></
textarea
>
<
small
>Report technical problems with this site to the <
a
href
=
"mailto:sasupport@case.edu"
>
webmaster</
a
>.</
small
>
</
telerik:RadToolTip
>
</
form
>
The sample code uses a separate tooltip but it can be easily customized for RadToolTipManager as well (you should reference the corresponding RadToolTip by using the tooltipManager.getToolTipByElement method).
Sincerely yours,
Svetlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I have to agree with Dani here, the ALT text property is not meant to be tooltip material, it's meant to display when the image url is broken and for screen readers. TITLE is the tag to use for tooltips...
I don't have a problem with RadToolTip replacing the tooltip, but please, only replace the tooltips, nothing more.
Run this in IE 8 or FF without RadToolTipManager and you'll only get one tooltip....
<img src="missing" alt="This is the alt text" /> |
<img src="button.png" alt="Button alt text" /> |
<img src="button.png" alt="Button alt text" title="Tooltip text" /> |
Run it with RadToolTipManager and you'll get three. This is inconsistent and unwanted behavior... as least for me.
Thanks for considering this,
Dominic.
If you test the code under IE6 and IE7 you will notice that all the Alt attributes are shown as tooltips. There is no way to prevent this from happening since this is browser specific behavior and in this case if we do not remove the Alt attribute you will always get two tooltips - one standard and one which is RadToolTip and thus after some research and discussions we have decided to remove the Alt when tooltipifying. This was so for AutoToolTipify functionality from the creation of the RadToolTipManager control and recently we implemented the same logic for a separate RadToolTip as well due to customers' requests for consistency.
Regards,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Seems like an odd thing to do...
Dominic.
In fact, ie6 is probably used more than we'd like to think:
http://www.w3schools.com/browsers/browsers_stats.asp
Most of my users (~90%) are on ie6... Corporations are very slow to change...
We won't start that debate here and now. ;) I worked in a bank for a while who upgraded to Windows XP (from NT4) in 2006(!) and even they installed IE7... And even Google has officially announced it drops IE6 support.
So, my point is that if IE6 and 7 do it one way and IE8 does it another way, it seems to indicate that the mentioned feature has no real future.
Sitenote: Don't base browser stats on w3shools, it's for web developers who know what they are doing. But god would I love to that 45+% of Firefox ! :)
IE6 and IE7 browsers are not obsolete yet as you can see from the statistics below:
http://www.w3schools.com/browsers/browsers_stats.asp
As you see, these browsers are still heavily used and especially by big corporations as Nicolai also said.
Note, also , that the RadToolTip control was created before IE8 was released and at that time those browsers were the most used ones and we believe that the behavior should not be changed only because a new browser was released and all we did was to make the already used behavior consistent due to customers' requests we received. However, we are gathering feedback and if it turns out that more people prefer to change the behavior we will consider do that.
Greetings,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
There is now an IgnoreAltAttribute property. Set to true it ignores ALT attributes in images.