Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:32

Link in a tooltip window


Poster: Derek Fielding
Dated: Wednesday April 21 2004 - 11:19:58 BST

I am trying to put a link in a tooltip window.

I note that some html commands eg bold work OK

I have included this line of code in my menu ver 5.12

aI("text=test html popup;onfunction=showtip('<a href= &acute;staff_saviour.html&acute; >Go to Staff Page</a>');separatorsize=20;");

The tooltip window appears and the link text is there but when I click the link I get a "javascipt void (0)" message on the staus bar and of course the link does not work. Should I be able to use this code in a tooltip window?
Can you help?
Derek Fielding


Poster: Ruth
Dated: Wednesday April 21 2004 - 12:57:42 BST

You may have to put in the full path to the page. I used links in my tips and they worked fine, but I had full paths. This is my code with your page subsituted
Code:
onfunction=showtip('<center><a href=http://www.your url.com/staff_saviour.html>Go to Staff Page</a></center>');separatorsize=20;");
Hope that helps.

Ruth


Poster: Derek Fielding
Dated: Wednesday April 21 2004 - 14:27:37 BST

Hi ruth, thanks for your reply
I still have the same problem - the tooltip appears OK but the link is inactive. When I click the link I still get the statusbar message
"javascript:void(0)"


I am using the tooltips.js plug in - do I need anything else to enable html in the tooltip?

My menu line now reads :-
aI("text=popup;onfunction=showtip('<center><a href=http://www.get-the-message.org.uk/staff_saviour.html>Go to Staff Page</a></center>');separatorsize=20;");

and my URL is :-

http://www.get-the-message.org.uk/index.html

I Hope you can spot the error

Derek


Poster: John
Dated: Wednesday April 21 2004 - 15:17:01 BST

Hi Derek -

I'm getting a JS error before the page even opens. It's complaining about close = new Image();, about line 65 or so in the HTML. I get this both on your site and on your code I downloaded to my server.


Poster: Derek Fielding
Dated: Wednesday April 21 2004 - 19:11:48 BST

Hi John,
I have spotted the offending code giving the "error on page" message.

However - I have posted a page completely stripped of everything but the Milonic menu so there can be no conflicts.
The link in the tooltip is still inactive. I think that the clue here is the fact that I still get the message "javascript:void(0) in the statusbar when I click the link.

The menu code line is the same :-
aI("text=popup;onfunction=showtip('<center><a href=http://www.get-the-message.org.uk/staff_saviour.html>Go to Staff Page</a></center>');separatorsize=20;");
This code was suggested by Ruth and is a copy of her code (which I must assume is working for her) with her modifications to reflect my page link.

The new URL is
http://www.get-the-message.org.uk/1test.html

Could you please take a look at it for me
Thanks
Derek


Poster: kevin3442
Dated: Wednesday April 21 2004 - 23:56:04 BST

Hi Derek,

I think the issue lies not so much in how you code your menu item as it does in the tooltips.js code itself. A tooltip is basically a menu, just like any other, except that it has only one item. That menu is defined in tooltips.js... it's called "M_toolTips" and it uses a menu style (also defined in tooltips.js) called toolTipStyle. You'll notice that the lone menu item in the M_toolTips menu has only one property, the text property, and it is not defined (it's blank). That's because the text property of that item is changed dynamically when you call the showtip() function using the onfunction property in one of your own menu items (in menu_data.js).

BTW: the fact that the menu item in the M_toolTips menu also has no defined url property and no clickfunction property explains why it fires javascript:void(0) when clicked. Any menu item without a url and without a clickfunction will do that... try clicking one of your own menu items that has a showenu defined but no url defined and you'll see what I mean.

Now, suppose you wanted to define a regular menu item of your own, and you wanted it to contain one or more <a> links. How would you do that? (think about it now.... don't just keep reading! ;) ) ...You'd set type=html in that item's aI() string. You could do the same thing for the tooltip menu item. Here's how:

(1) Open tooltips.js in your text editor.

(2) Edit line 22 so that instead of
Code:
aI("text=;");

it becomes
Code:
aI("text=;type=html;");


(3) Save the new tooltips.js file, replacing the old one.

Give that a shot and let us know how it comes out.

Kevin


Poster: Ruth
Dated: Thursday April 22 2004 - 0:28:06 BST

Thanks Kevin. Though mine works I found that the actual click for the link is someplace over towards the end of the tip window, though I never noticed it before...and in Derek's if you mouse over and back a few times you'll see it but you can't really find the link. I have been messing with the margin, padding and such forever trying to see why it's doing that. Glad you checked it, so I can now fix mine also.

EDIT: it works, thanks Kevin!

Ruth


Poster: Derek Fielding
Dated: Thursday April 22 2004 - 1:53:19 BST

Hi Kevin,
Yes - that did it: the link now opens OK

The example I posted was just a simple test to se if it was possible.
Now that I know that it is I have a specific task to perform, hopefuly using this method.

I want to put my site serarch facility within the menu so that it will be available on all pages and will scroll with the menu

At the moment it is a separate item above the menu on URL
http://www.get-the-message.org.uk/index.html

The code to set out the search box is

'<font face=arial color=black size=2><Div align=justify><B>Enter your search word(s) in the box below and click the SEARCH button.<br><br>We will search our site for you and display all the pages and links found.</div><br><center><Form Method=\'get\' action=\'http://search.atomz.com/search/\'><br><input size=21 name=\'sp-q\' value=\'\' onclick=\'clearText();\'><input type=hidden name=\'sp-a\' value=\'sp100309e4\'><input type=submit STYLE=\'background:1300ca;color:ffffff\' value=\'Search \'></center></form>'

Trying to mod this code to work in the tooltip is beyond my 60+ year old brain. Do you fancy having a shot at it?

Derek


Poster: Ruth
Dated: Thursday April 22 2004 - 2:36:44 BST

Under Beginner's Guide in the forum, Maz has posted information on putting forms in a menu. One of the examples she uses is the search form...taken from her site. http://www.milonic.com/forum/viewtopic.php?t=4045

Ruth


Poster: Derek Fielding
Dated: Thursday April 22 2004 - 5:10:39 BST

Thanks Ruth,

I have done exactly what I wanted to do. I put the sub-menu in a table so that I could border it and add bgcolor and fonts to the first row to simulate a caption. Thanks to all who helped on this topic. Fantastic result.

If your interested to see the final result the URL is
http://www.get-the-message.org.uk/index.html

regards

Derek


Poster: Ruth
Dated: Thursday April 22 2004 - 7:24:11 BST

Looks good. What happened to the tooltips? I didn't see any.

Ruth


Poster: Derek Fielding
Dated: Thursday April 22 2004 - 9:58:33 BST

Hi Ruth
I still have tooltips on the menu items "Curates Pages" and "Guestbook"

After being so elated at getting a fantastic result I have just been brought down to earth with a bump !!
Viewed in IE the page is fine with no errors reported but if I check the page in Netscape 4.7 the load stops after the main menu loads and I get an error message "Javascript error: Type 'javascript into Location for details". When I do this it attempts to connect to keyword.netscape.com but always fails.
If I remove the "searchsite" sub menu the page loads correctly in Netscape.

The code for that menu is
with(milonic=new menuname("searchsite")){
style=menuStyle1;
overflow="scroll";
keepalive=0;
aI("text=<table width=200 border=2 bordercolor=red bgcolor=#ffffcc cellpadding=10><tr height=20 bgcolor=#3904B2 align=center><td><font size=2 color=white><b>SEARCH OUR PAGES</b></font></td></tr><tr><td><Div align=justify> <font face=arial color=black size=2><b> Enter your search word(s) in the box below and click the SUBMIT QUERY button.<br><br>We will search our site for you and display all the pages and links found.</b></font></div><br><center><Form Method=get action=http://search.atomz.com/search/><br><input size=21 name=sp-q ><input type=hidden name=sp-a value=sp100309e4><input type=submit STYLE=background:blue;color:ffffcc value=Search ></center></form></td></tr></table> ;type=form;offbgcolor=#FFFCF3;separatorsize=0;");

}

The URL is :-
http://www.get-the-message.org.uk/index.html

There must be something in the code that Netscape does not like - Can anyone spot the error

a despondent Derek :cry:


Poster: Derek Fielding
Dated: Thursday April 22 2004 - 11:44:42 BST

I have discovered that if I remove all code to do with tables the page loads in netscape.

However I have now discovered that the form loads BEHIND other objects in NETSCAPE only.

Is there a way round this

Best wishes

Derek


Poster: Maz
Dated: Thursday April 22 2004 - 12:04:41 BST

I don't know what's going on with Netscape and forms.

you don't need these and can remove them:
overflow="scroll";
keepalive=0;

Just an idea try leaving no spaces, like >;

Sory I don't have good solution.

maz


Poster: Derek Fielding
Dated: Thursday April 22 2004 - 18:01:05 BST

I cannot beleive that, after all this effort and such a good result in IE, I am going to have to abandon my menu driven search form because of the shortcomings of the Netscape browser. :x

Is everyone having the same problems with Netscape or is it lack of experience on my part?

I would also pose the question - why do people use Netscape - are there any advantages compared to IE?

Derek


Poster: Ruth
Dated: Thursday April 22 2004 - 19:24:21 BST

It's not the netsape browser, the page works in 6, 7. It's the netscape 4x browsers and therefore the people still using them. I would not change the menu for that. Instead perhaps you could put a javascript alert which would hit if the person were using netscape 4x, and say something like "You are using netscape 4x which is not a dynamic browser. If the search box in the menu does not function, use the search option at the bottom of the page, and we do recommend that you upgrade your browser to better enjoy all the new capabilities of the newer codes being created. " However you want to phrase it. Then way at the bottom of the page, put in a search box. I think you should keep what you have and not change it for a small percentage of browsers to the detriment of the larger percentage of newer browsers. I'm sorry I don't have a clue how to do the alert but I know there are those on the forum who do.

Ruth


Poster: John
Dated: Thursday April 22 2004 - 19:54:05 BST

I suspect that could go inside a <noscript></noscript>.

Wording would be something like, "You silly twit. Why in the world are you using a browser so old and unsupported, not to mention security-challenged? This has caused me all kinds of extra work just to post my search box for you. Join the world of today - upgrade".

Just a thought... :roll:


Poster: Ruth
Dated: Thursday April 22 2004 - 19:58:23 BST

:lol: Funny!! But, I don't think a nice church site would feel comfortable saying that... :) Ok, now what could go in noscrift tags? The alert? then it wouldnt' work on netscape 4x that has javascript enabled, would it? Sorry, I have no clue how to do the alert, though I know it can be done, javascript alert.

Ruth


Poster: John
Dated: Thursday April 22 2004 - 20:00:07 BST

No, not the alert - the search box code.


Poster: Derek Fielding
Dated: Friday April 23 2004 - 8:31:27 BST

You are quite right. I have been trying to support an out of date browser.
On checking I find that only 2% of my visitors use Netscape and of those none are V4 browsers.

I am happy to use any page that works on my system and also pass W3C verification.

Thanks again to all who helped me with this issue.

Derek Fielding :D