Text Popup Effects

This forum is for all Flare issues not related to any of the other categories.
Post Reply
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Text Popup Effects

Post 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
Paul Pehrson
My Blog

Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Text Popup Effects

Post 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.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Text Popup Effects

Post by Craig.Prichard »

Has anyone successfully implemented mouseover popups for glossary terms, i.e. on hover instead of click? Thanks.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Text Popup Effects

Post 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.
Inge____________________________
"I need input! - Have you got input?"
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Text Popup Effects

Post by Craig.Prichard »

Inge,

Can you share that javascript with us? Thank you.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Text Popup Effects

Post 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.
Inge____________________________
"I need input! - Have you got input?"
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Text Popup Effects

Post by Craig.Prichard »

Thank you very, very, very much!
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Text Popup Effects

Post 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 ...
Inge____________________________
"I need input! - Have you got input?"
Craig.Prichard
Propeller Head
Posts: 62
Joined: Sat Dec 10, 2005 8:06 pm
Location: Calgary, AB Canada

Re: Text Popup Effects

Post by Craig.Prichard »

Big time thank you!
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Text Popup Effects

Post 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
Inge____________________________
"I need input! - Have you got input?"
Post Reply