menu rollover

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Roadserver
Advanced
Advanced
Posts: 17
Joined: Thu Jul 15, 2004 6:01 pm

menu rollover

Post by Roadserver »

Hello!

I have a problem

or

is the following point possible.


I like the menu at the following link:

http://milonic.com/menusample17.php


If you go to Milonic and then to faq (example) then i want that the picture of the animal with glasses change in a other picture (indirect rollover) is that possible?

I'm a beginner with scripts!

Who can help me!

Or send me the changed scripts


Greetz

Roadserver (Dutch)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

To make sure we understand what you want: You mouseover the Milonic, the animal changes to one with glasses. You move the mouse down to FAQS and when you highlight FAQS you now want the animal picture with glasses next to the Milonic to change to a totally new image? If this is true, I think it might require a javascript, if it is possible to do at all.

Ruth
Roadserver
Advanced
Advanced
Posts: 17
Joined: Thu Jul 15, 2004 6:01 pm

Post by Roadserver »

Ruth wrote:To make sure we understand what you want: You mouseover the Milonic, the animal changes to one with glasses. You move the mouse down to FAQS and when you highlight FAQS you now want the animal picture with glasses next to the Milonic to change to a totally new image? If this is true, I think it might require a javascript, if it is possible to do at all.

Ruth
Yes thats what i want! But i'm a beginner.
My question is who can help me with this script of make it for me.
FAQ is a example, other subjects in de menu must have the same roll over with other pictures.

Thanks Ruth............maby you can help me..........
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Roadserver,

I think I can help you. Ruth is correct... you'll need to throw in a little extra javascript. Copy the follwing function into the top of your menu_data.js file:

Code: Select all

function setParentOverImage(imageName)
{
  parentItem = getParentItemByItem(_itemRef);
  _mi[parentItem][32] = imageName;
  BDMenu(_mi[parentItem][0]);
}
This function would be called from the onfunction and offfunction properties of the menu item that you want to trigger the rollover. When you call the function, pass the name (and path if needed) of the image you want to use.

Using the example from your first post, the FAQ menu item would become like this:

Code: Select all

aI("text=FAQ;url=http://milonic.com/menufaq.php;onfunction=setParentOverImage('zippo_over.gif');offfunction=setParentOverImage('penfold_over.gif');");
(all on one line, with no wrapping or line breaks).

In this example, when you mouse over the "FAQ" menu item, its onfunction property calls the setParentOverImage() function, setting the parent item's overimage to 'zippo_over.gif' (the open lighter image that comes with the example). When you mouse off of the FAQ item, its offfunction property calls setParentOverImage() again, setting the parent item's overimage back to its original 'penfold_over.gif'.

Hope that helps,

Kevin
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

Post by ttmobil »

Hi!

I have the same menu with my own pics!

But I have a time problem! The mouseover effect is to slow.
The pics are 1,5 kb big.

What is the problem????


Thanks Tim
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi ttmobil,
Can you give us a url? We need to see what's happening. Also, what OS and browser are you using so we know which is slow?

Ruth
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

1.5K is, of course, a very small file. However, if you have a lot of images (i.e., a large menu) it could slow things down.

You might want to try preloading your images, as explained here by Kevin.
John
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

Post by ttmobil »

Hi!

I am using ie!

Here is the link:
http://www.ttr-friends.de/ttr-friends-d ... n/head.htm

I hope, you can help me! I can gif you any information you need!
I hope my english is good enough!


by Tim
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi ttmobil,
I tested your page and it isn't slow once the images load and are in the cache. You have a lot of images and the slow first mouseover is because the image has not loaded yet. You need to go to the link John gave and use the preloadmenuimages.js file. Follow the directions that Kevin has posted at that link.

Ruth
Roadserver
Advanced
Advanced
Posts: 17
Joined: Thu Jul 15, 2004 6:01 pm

Post by Roadserver »

Tanks kevin and Ruth,

It works!!
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

Post by ttmobil »

Hi Ruth!

I make the changes! But the menu is not faster!
I put the script: <script language=Javascript src="preloadmenuimages.js" type=text/javascript></script> into the head.htm after the menu call and the preloadmenuimages.js to the menu stuff!

Test it again!
What means: (i.e., after all the aI() stuff)???


Tim
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi ttmobile,
i.e. is an acronym for the latin words meaning 'that is'. So, in the context of Kevin's post it would be
(2) Load preloadmenuimages.js into your page at some location after your menus have been defined (i.e., after all the aI() stuff),
that is, after all the aI( information you have in your menu_data file has been 'read, rendered, written' by the browser,
so that the preload function knows what images it needs to get.
I don't know why it isn't faster. Which version of IE do you have and how do you connect to the internet? Also, and I don't know if this matters, but in the preloadmenuimages.js file it shows the call for the file as

Code: Select all

<script language="JavaScript1.2" type="text/javascript" src="preloadmenuimages.js"></script> 
You would use your path of course, but I saw that script language=JavaScript1.2 and don't know if that needs to be in there? I'm sorry I can't be more help.

Ruth

Ruth
Roadserver
Advanced
Advanced
Posts: 17
Joined: Thu Jul 15, 2004 6:01 pm

Post by Roadserver »

Did you have an example of preloading?

Link?
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

Post by ttmobil »

Hi Ruth!

I use IE6.0 and I connect the internet by DSL1500. I think that is fast enough.

Mhhh, where is the mistake????

The original menu is fast!


I dont know!

Bye Tim
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Roadserver,
John posted a link to Kevin's Preloadmenuimages post. Also, Milonic uses the preloadmenuimages on the site.

Tim,
The original has only 6 images, you have 28. That may contribute to it. If I think of something I will let you know.

Ruth
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

Post by ttmobil »

Hi Ruth!

one question:

the preloader is only for a menu 5.16 or higher!
I use a 5.00 Menu!

I think this is the reason why the preloader does not work!

Can I get a free menu 5.16 on milonic??????

Thanks for your answere!

Tim
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

You have version 5.26. I still think the problem is the number of images, there are 28 of them totaling about 58k or so. I do remember that some of my own home made images on my site, even though they were small seemed to load slowly [not menu images, site images] I never could figure out why they did that.

Ruth
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Yes it sounds like you need to upgrade, the free menu comes with a milonic link, if you don't want the link in the menu then add the link in the page and the menu link will go away.

maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

"Officially", for support, you need to be at the current version - 5.33 as this is written.
John
ttmobil
Advanced
Advanced
Posts: 14
Joined: Sat Jul 17, 2004 1:30 am

@ kevin3442

Post by ttmobil »

@kevin3442

Can you have a look at the two menu-links.

Both with the preloader, but can you check the quellcode, that everthing is ok??? I cant believe, that the menu is so slow!!!!!?????

The problem is, I am an beginner!

http://www.ttr-friends.de/ttr-friends-d ... u/head.htm

http://www.ttr-friends.de/ttr-friends-d ... n/head.htm


Thanks!
Post Reply