Page 1 of 1
tooltips?
Posted: Fri Apr 08, 2011 8:37 am
by sgartley
Is it possible to configure something so that when users scroll over a word in a topic (an acronym, for example) a tooptip containing a brief definiton will display? I thought maybe I could do this with glossary items but I don't see a way to do it so they don't have to click on the word. I tried to find an answer to this in the help files and in this forum but so far haven't found anything.
Thanks!
Sharon
Re: tooltips?
Posted: Tue Apr 12, 2011 6:33 am
by crdmerge
You inadvertently provided your own answer.
<acronym title="MyTooltip">MyWord</acronym>
Then you can add styles for a > acronym in your css style sheet.
Good luck,
Leon
Re: tooltips?
Posted: Tue Apr 12, 2011 7:47 am
by i-tietz
Or insert this into your masterpage if you use marked glossary items:
Code: Select all
<script type="text/javascript">
<!--
window.onload = onclick2onmouseover;
function onclick2onmouseover() {
var input = 'onclick';
var output = 'onmouseover';
var numberlinks = document.links.length;
for (var counter=0;counter<numberlinks;counter++)
{
if (document.links[counter].className == "MCTextPopupSpot_Popup_0")
{
document.links[counter].parentNode.innerHTML = document.links[counter].parentNode.innerHTML.replace(input,output);
}
}
}
-->
</script>
</head>
<body>
Re: tooltips?
Posted: Tue Apr 12, 2011 8:03 am
by NorthEast
i-tietz wrote:Or insert this into your masterpage if you use marked glossary items:
I'm just getting an object reference error when I try that code.
Re: tooltips?
Posted: Tue Apr 12, 2011 8:17 am
by i-tietz
I edited the code - try again with new version.
Re: tooltips?
Posted: Tue Apr 12, 2011 9:33 pm
by Craig.Prichard
I've taken the original code, which only supported onmouseover() for glossary terms, and expanded it to work for any number of dropdowns, expanding text, and togglers in a topic.
Code: Select all
<script type="text/javascript">/*<![CDATA[*/
window.onload = onclick2onmouseover;
function onclick2onmouseover() {
var input = 'onclick';
var output = 'onmouseover';
for (i=0;i<document.links.length;i++) {
// alert(document.links[i].className);
//glossary entries
if (document.links[i].className.indexOf("MCTextPopupSpot_") !=-1) {
document.links[i].parentNode.innerHTML = document.links[i].parentNode.innerHTML.replace(input,output); }
//dropdowns
if (document.links[i].className.indexOf("MCDropDownHotSpot_") !=-1) {
document.links[i].parentNode.innerHTML = document.links[i].parentNode.innerHTML.replace(input,output); }
//expanding
if (document.links[i].className.indexOf("MCExpandingHead_") !=-1) {
document.links[i].parentNode.innerHTML = document.links[i].parentNode.innerHTML.replace(input,output); }
//togglers
if (document.links[i].className.indexOf("toggler_") !=-1) {
document.links[i].parentNode.innerHTML = document.links[i].parentNode.innerHTML.replace(input,output); }
}
}/*]]>*/
</script>
Enjoy.
Re: tooltips?
Posted: Wed Apr 13, 2011 12:59 am
by NorthEast
Craig.Prichard wrote:I've taken the original code, which only supported onmouseover() for glossary terms, and expanded it to work for any number of dropdowns, expanding text, and togglers in a topic.
This only works for v7. I'd suggest removing the '_' off the end of each class name, and it'll work in v6 and v7.
However, after a minute or two of testing, I found this quite annoying; because the glossary will pop-up on a mouseover, but you then have to click to get rid of it.
That means you have to be careful where you move your mouse across the page, which for me makes it much more more of an inconvenience than it is worth.
Really, you'd want the glossary pop-up to disappear when you move the mouse off the term.
Re: tooltips?
Posted: Wed Apr 13, 2011 2:00 am
by NorthEast
i-tietz wrote:I edited the code - try again with new version.
Although this code doesn't generate an error any more, it still doesn't seem to work.
Looking at your code, it is looking for a tag with a class
MCTextPopupSpot_Popup_0 ; but that class doesn't exist in my output - when generated using either v6 or v7.
My glossary pop-ups have a class of
MCTextPopupSpot_0. If I change your code to match this, it seems to work in FireFox 4 but not for IE9. Also, that class is only valid for Flare v7, and wouldn't work for v6.
Craig's code seems to work though - and you can remove the elements you don't want to pop-up.
Re: tooltips?
Posted: Wed Apr 13, 2011 8:59 am
by Craig.Prichard
Dave Lee wrote:This only works for v7. I'd suggest removing the '_' off the end of each class name, and it'll work in v6 and v7.
Good catch.
Dave Lee wrote:However, after a minute or two of testing, I found this quite annoying; because the glossary will pop-up on a mouseover, but you then have to click to get rid of it. That means you have to be careful where you move your mouse across the page, which for me makes it much more more of an inconvenience than it is worth.
Yes, it's annoying. Yes, random mouse movement will frustrate the user.
Dave Lee wrote:Really, you'd want the glossary pop-up to disappear when you move the mouse off the term.
I agree but it's beyond the scope of my skills to make the more significant modification of replacing
with something similar to
Code: Select all
onmouseover="FMCPopupThumbnail_Onmouseover( event, this )
I would likely incorporate the solution if someone else produced it.
Any takers?
Sidebar: my code is bloated with four (4) "if" statements because I couldn't get ORing to work to combine them. I know the code can be refactored and welcome anyone's success at doing so and posting here. Thank you.
Re: tooltips?
Posted: Wed Apr 13, 2011 9:07 am
by Craig.Prichard
...it is looking for a tag with a class MCTextPopupSpot_Popup_0...
Instead of comparing against an exact string match, my code looks to see if the substring
MCTextPopupSpot is part of the classname.
...it seems to work in FireFox 4 but not for IE9...
I'm running IE8 in IE7-compatibility mode (my clients' limitation, not mine) so I can't test for IE9.
...that class is only valid for Flare v7, and wouldn't work for v6.
I have removed the underscores for compatibility with Flare v6 but have not modified the code posted in this thread. I'm hoping to incorporate a refactored version with a single compound "if" and then I'll post the revised code.
Re: tooltips?
Posted: Thu Apr 14, 2011 12:47 am
by NorthEast
Craig.Prichard wrote:...it seems to work in FireFox 4 but not for IE9...
I'm running IE8 in IE7-compatibility mode (my clients' limitation, not mine) so I can't test for IE9.
My second post was about i-tietz's code; yours worked fine in IE9.
Re: tooltips?
Posted: Thu Apr 14, 2011 1:46 am
by i-tietz
IE 9 is available for about 4 weeks now ... experience tells me to not use it before 6 months have passed and the third fix has been published ...
Adjusting anything to make it run in the current version could well explode right into your face in a couple of months.
Re: tooltips?
Posted: Thu Apr 14, 2011 3:01 am
by NorthEast
i-tietz wrote:IE 9 is available for about 4 weeks now ... experience tells me to not use it before 6 months have passed and the third fix has been published ...
Adjusting anything to make it run in the current version could well explode right into your face in a couple of months.
Fair enough, but regardless of browser, your code still didn't work for me anyway, as it's looking for a specific class name that doesn't exist in my output. That'd suggest the generated class name might vary between Flare versions or settings, so it'd need to use Craig's approach of using a substring of the class name.
Re: tooltips?
Posted: Thu Apr 14, 2011 3:53 am
by i-tietz
aha.
Sorry for not giving you the exact code for each browser in each version on each operating system and with each single interfering security setting and for each Flare version.
Won't happen again.
Re: tooltips?
Posted: Thu Apr 14, 2011 4:36 am
by NorthEast
i-tietz wrote:aha.
Sorry for not giving you the exact code for each browser in each version on each operating system and with each single interfering security setting and for each Flare version.
Won't happen again.
Er... I'm also sorry that I wasted time trying out your code and identifying some problems.
Re: tooltips?
Posted: Thu Apr 14, 2011 6:05 am
by i-tietz
If I deliver code suitable for all possible situations I take money for it. For the very simple reason that it takes a lot of time - as you've obviously found out, too ...
Re: tooltips?
Posted: Thu Apr 14, 2011 7:43 am
by RamonS
i-tietz wrote:IE 9 is available for about 4 weeks now ... experience tells me to not use it before 6 months have passed and the third fix has been published ...
Adjusting anything to make it run in the current version could well explode right into your face in a couple of months.
You may need to revisit this position. Microsoft announced to release IE10 later this year.