Page 1 of 1
Text Popup Effects
Posted: Tue May 05, 2009 7:36 am
by doc_guy
Hey all,
Can you let me know if there is a way to set Text popups to appear as a hover action, rather than a click action?
Thanks!
-Paul
Re: Text Popup Effects
Posted: Tue May 05, 2009 9:25 pm
by LTinker68
I don't have Flare open at the moment, so I don't remember if it automatically adds a Javascript event to the <a href...> link. I don't think it does, so the only options I can think of is to A) create your own link with custom inline Javascript code to open a topic in a new window on a mouseover event, or B) modify the Flare Javascript file to use onmouseover instead of onclick. Depending on how that JS file is coded, that might pass the effect to all hyperlinks or to all popup links (including glossary popups). So I think option A is your best bet.
Re: Text Popup Effects
Posted: Mon Mar 28, 2011 2:21 pm
by Craig.Prichard
Has anyone successfully implemented mouseover popups for glossary terms, i.e. on hover instead of click? Thanks.
Re: Text Popup Effects
Posted: Tue Mar 29, 2011 8:04 am
by i-tietz
Craig.Prichard wrote:Has anyone successfully implemented mouseover popups for glossary terms, i.e. on hover instead of click? Thanks.
No, not in a glossary. But in a current project I have a javascript in the masterpage for all topics. Amongst other things it rewrites links that contain bookmarks (e.g. topic.htm#bookmarkone). That javascript is triggered by the "onload" event.
Something like that should work in the glossary as well as in a topic with a glossary term. Just stuff it in to the relevant masterpage.
Re: Text Popup Effects
Posted: Wed Mar 30, 2011 5:53 am
by Craig.Prichard
Inge,
Can you share that javascript with us? Thank you.
Re: Text Popup Effects
Posted: Wed Mar 30, 2011 6:04 am
by i-tietz
Craig.Prichard wrote:Can you share that javascript with us? Thank you.
It's a coop of javascript, masterpage, stylesheet and templates ... I need to make a dummy project out of it, before I can attach it. Takes a bit of time.
Re: Text Popup Effects
Posted: Wed Mar 30, 2011 6:10 am
by Craig.Prichard
Thank you very, very, very much!
Re: Text Popup Effects
Posted: Wed Mar 30, 2011 6:52 am
by i-tietz
goodness ... *banging the head on the table* ... you only need the rewriting-the-link-stuff ...
Please note:
This works for
Internet Explorer (because of the "document.all"), not in Mozilla ... Chrome: no idea.
(We're producing HTML Help, so IE is good enough) There are other methods that work for Mozilla, but I didn't have to find out cos' we don't need it.
The script:
1. looks for links that include a bookmark, because only those links will be changed (for reasons you don't see here, but are in the rest of the masterpage/script/stylesheet)
2. drops the "href" in those links and inserts an "onclick"
To use this script:
You should go and have a look at the source code of the glossary. You can use the links inside the DropDownHeads - find them them via their class.
Code: Select all
<script type="text/javascript">
<!--
window.onload = adaptLinks;
window.onresize = adaptLinks;
function adaptLinks()
{
if (document.all)
{
// parse document URL to compare with link targets
var address = document.URL;
var hasbookmark = address.split("#");
var wholepath = hasbookmark[0].split("chm::");
var pathinchm = wholepath[1];
var path = hasbookmark[0].split("/");
var countelements = path.length;
var lastelement = countelements - 1;
var file = path[lastelement];
// Change link targets to local bookmarks
// *************************
// LOOP OVER DOCUMENT LINKS
// *************************
var aaddress = "";
var apath = "";
var alastelement = 0;
var afile = "";
var countlinks = document.links.length;
for (var countup=0;countup<countlinks;countup++)
{
// parse href of link for more information
aaddress = document.links[countup] + "";
ahasbookmark = aaddress.split("#");
// link has bookmark?
if (ahasbookmark[1] != null)
{
// bookmark in this document?
apath = ahasbookmark[0].split("/");
alastelement = apath.length - 1;
afile = apath[alastelement];
if (file == afile)
{
// delete href and insert onclick
targetnew = pathinchm + document.links[countup].hash;
newtext = "javascript:void(window.location.href = '" + targetnew + "');location.reload();";
document.links[countup].href = newtext;
}
}
}
}
}
// -->
</script>
As you see there's quite a bit of adapting to do ...
Re: Text Popup Effects
Posted: Thu Mar 31, 2011 5:24 am
by Craig.Prichard
Big time thank you!
Re: Text Popup Effects
Posted: Tue Apr 12, 2011 7:53 am
by i-tietz
Here I have another javascript for having popups on mouseover rather than on mouseclick:
http://forums.madcapsoftware.com/viewto ... 13&t=12847