OnmouserOver-Event, openstyle

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

OnmouserOver-Event, openstyle

Post by Natascha »

Hi all,

i have two questions:

1. I am trying to implement an onmouseover-effekt in my menu.

Code: Select all

aI("showmenu=Produkte;text=Produkte;url=products.htm;target=mainFrame");
I want to open the target products.htm while going with the mouse over the link.

is this possible?

2. question:
if i open my menus with openstyle="up" sometimes i cant see my main-menu... is it possible to enter a code so that the menu opens up and right? --> to the right side of the horizontal-menu??

thanks for your help...
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

onmouseover

Post by Migru »

Hi

it is always better, to provide a url - testpage
where the issue can be studied.

You are working with frames, is that correct ? Please specify your question and provide a url. Thats better.
Michael

Activating functions on mouseover
http://milonic.com/menusample15.php
popup function sample
http://milonic.com/menusample24.php
another possibility is to display an overimage only with an offset somewhere on the page.
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

sorry - here is my example-page:

http://www.hmk.de/test

i am working with frames - but i did not manage the frame-menus - so i changed it simply to openstyle"up".. :D
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

Natascha wrote:sorry - here is my example-page:

http://www.hmk.de/test

i am working with frames - but i did not manage the frame-menus - so i changed it simply to openstyle"up".. :D

i tested the onmouse-over... but i am sure i used it wrong...

Code: Select all

aI("showmenu=Produkte;text=Produkte & Geschäftsbereiche;url=javascript:onmouseover(products.htm);target=mainFrame");
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Natascha wrote:....

i am working with frames - but i did not manage the frame-menus - so i changed it simply to openstyle"up".. :D
Did you take a look at the demo for frames? It has an in depth explanation.

http://support.milonic.com/demos/frames/index.htm

As to the other, I think you need a function to tell the menu to open the link on mouseover and I think, this is not anything I know much about, but I think the function has to include a place to put the url/target, rather than using the target= feature of the menu.

Ruth
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

onMouseover

Post by Migru »

Hi

it is not really clear, what your intention is,

do you just want to ad a link to a menu item - at the same time "showmenu" the submenu-items ?
aI("text=Sample Link;url=index.html;showmenu=submenu");
http://milonic.com/menufaq.php

Had a brief look on your menudata file, so some of the menu items are working and there should not be any difficulty to do it in the same way with the others.

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

Post by Ruth »

Hi Michael,

You know when you have an html link on a page you can do a javascript and have the link work when you mouseover it instead of when you click it? Usually it either takes you to the page, opens it in a new window, or can open it in a frame. For example, assume a frameset with a top frame named Nav and bottom named Content. You could create a link in Nav to test.html page and have it open in the content frame onmouseover.

Code: Select all

<a href="test.html" onmouseover="parent.Content.location='test.html';">test mouseover</a>

In this case I think Natascha wants to be able to mouseover the Produkte & Geschäftsbereiche and have the submenu open as it does and also have the page open in the mainFrame at the same time. I don't know how to change the link I posted to get it to work in the url= parameter of the menu.


Ruth
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

thanks for your answers - but i had to change my menu a little bit.

now i am opening another menu after clicking on the button "produkte" but with my mozilla-browser there seems to be a problem.

maybe someone with mozilla can have a look at my second menu after clicking on produkte? i tried it with the itemhigh-option but the vertical-menu is still to big...

thanks for your help..

http://www.hmk.de/test
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

itemheight

Post by Migru »

Hi

Place

itemheight=25;

into your menu (mainmenu code, submenu code)
Something like this:

with(milonic=new menuname("SubMenu")){
style=menuStyle;
itemheight=25;
itemwidth=100;


Please see:
http://milonic.com/itemproperties.php
http://milonic.com/beginner.php

Michael
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

thanks - i did it - but it did not change..

Code: Select all

alwaysvisible=1;
left=0;
top=110;
orientation="vertical";
style=menuStyle;
itemheight=25;
itemwidth=100; 
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

Just downloaded your code

Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;
with(menuStyle=new mm_style()){
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=1;
fontfamily="Trebuchet MS";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#ffffff";
offbgcolor="#339933";
offcolor="#ffffff";
onbgcolor="#339933";
oncolor="#eeeeee";
<!--menubgimage="sheet.gif";-->
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=3)";
padding=4;
pagebgcolor="#339933";
pagecolor="white";
separatorcolor="#ffffff";
separatorsize=1;
separatorpadding=1;
subimage="arrow.gif";
subimagepadding=2;
}

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
top=110;
orientation="horizontal";
style=menuStyle;
menuwidth="100%";
menualign="left";
aI("text=Home;url=http://www.hmk.de/test;target=_parent");
aI("showmenu=HMK;text=Über uns;");
aI("text=Produkte & Geschäftsbereiche;url=products.htm;target=mainFrame");
aI("showmenu=Service;text=Service;");
aI("showmenu=Partner;text=Partner;");
}

<!--with(milonic=new menuname("Produkte")){
<!--style=menuStyle;
<!--openstyle="up";
<!--top="offset=1"; 
<!--aI("text=Storage & Data Management;url=storage.htm;target=mainFrame;");
<!--aI("text=Security & Access;url=security.htm;target=mainFrame;");
<!--aI("text=Turn Key & Media Lösungen;url=turnkey.htm;target=mainFrame;");
<!--aI("text=Produktpartner;url=partners.htm;target=mainFrame;");
<!--
}

with(milonic=new menuname("Service")){
style=menuStyle;
openstyle="up";
aI("text=Consulting;url=consulting.htm;target=mainFrame;");
aI("text=Support;showmenu=Supportsub");
aI("text=Operation;url=operations.htm;target=mainFrame;");
}

with(milonic=new menuname("Supportsub")){
style=menuStyle;
openstyle="up";
aI("text=Public;url=public.htm;target=mainFrame");
aI("text=Privat;url=private.htm;target=mainFrame;");
}

with(milonic=new menuname("Partner")){
style=menuStyle;
openstyle="up";
aI("text=Reseller;showmenu=Resellersub");
aI("text=Vendors & Supplier;url=vendors.htm;target=mainFrame;");
}

with(milonic=new menuname("Resellersub")){
style=menuStyle;
openstyle="up";
aI("text=Programm;url=programm.htm;target=mainFrame;");
}

with(milonic=new menuname("HMK")){
style=menuStyle;
openstyle="up";
aI("text=HMK Group;url=hmkgroup.htm;target=mainFrame;");
aI("text=Firmen;url=companies.htm;target=mainFrame;");
aI("text=Historie;url=history.htm;target=mainFrame;");
aI("text=Adressen;url=adresses.htm;target=mainFrame;");

}

drawMenus();

there is nowhere an "itemheight" property ??
And in javascript comments are better done that way

// comment in JavaScript

than HTML style

<!-- comment -->

Michael


PS I´m sorry, forgot

menu_data2.js

That is here

Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=0;
_subOffsetLeft=0;




with(menuStyle=new mm_style()){
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=1;
fontfamily="Trebuchet MS";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#ffffff";
offbgcolor="#339933";
offcolor="#ffffff";
onbgcolor="#339933";
oncolor="#eeeeee";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=3)";
padding=4;
pagebgcolor="#339933";
pagecolor="white";
separatorcolor="#ffffff";
separatorsize=1;
separatorpadding=1;
subimage="arrow.gif";
subimagepadding=2;
itemheight=25;
itemwidth=100; 

}



with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
top=110;
orientation="vertical";
style=menuStyle;
itemheight=25;
itemwidth=100; 

menualign="left";
aI("text=Storage & Data Management;showmenu=Storagesub");
aI("text=Security & Access;url=security.htm;target=_self;");
aI("text=Turn Key & Media Lösungen;url=turnkey.htm;target=_self;");
aI("text=Produktpartner;url=partners.htm;target=_self;");
}

with(milonic=new menuname("Storagesub")){
style=menuStyle;
itemheight=25;
itemwidth=100; 
aI("text=Allgemein;url=storage.htm;target=_self");
aI("text=Backup & Recovery;url=backup.htm;target=_self");
aI("text=HSM;url=hsm.htm;target=_self;");
aI("text=HSM Customizing Tools;url=hsmcustom.htm;target=_self;");
aI("text=NAS Head;url=nashead.htm;target=_self;");
aI("text=Data & Resource Management;url=data.htm;target=_self;");
aI("text=Mail & File Archiving;url=mail.htm;target=_self;");
aI("text=Ausgewählte Hardware;url=hardware.htm;target=_self;");
}
drawMenus();

Pls call that second menu Main Menu2

At the moment cannot trace additional syntax errors.

Michael
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

menu in a table ???

Post by Migru »

I am not certain,

do you have the second menu placed in a table ?

If so, there will be always problems with different browsers, if you do not comply with certain necessary standards, Please see

http://milonic.com/menusample9.php


Michael
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Menu in a table

Post by Migru »

just after the <body> tag place the code

Code: Select all

<BODY bgColor="#cccccc">
 <SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>	
<script	language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");		
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); 
</script>
<script type="text/javascript" language="JavaScript" src="menu_data2.js" ></SCRIPT>
The menu_data2.js file should contain everything, but not the main menu:

Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=0;
_subOffsetLeft=0;

with(menuStyle2=new mm_style()){
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=1;
fontfamily="Trebuchet MS";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#ffffff";
offbgcolor="#339933";
offcolor="#ffffff";
onbgcolor="#339933";
oncolor="#eeeeee";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135,Strength=3)";
padding=4;
pagebgcolor="#339933";
pagecolor="white";
separatorcolor="#ffffff";
//separatorsize=1;
//separatorpadding=1;
subimage="arrow.gif";
subimagepadding=2;
}

with(milonic=new menuname("Storagesub")){
style=menuStyle2;
aI("text=Allgemein;url=storage.htm;target=_self");
aI("text=Backup & Recovery;url=backup.htm;target=_self"); 
aI("text=HSM;url=hsm.htm;target=_self;");
aI("text=HSM Customizing Tools;url=hsmcustom.htm;target=_self;");
aI("text=NAS Head;url=nashead.htm;target=_self;");
aI("text=Data & Resource Management;url=data.htm;target=_self;");
aI("text=Mail & File Archiving;url=mail.htm;target=_self;");
aI("text=Ausgewählte Hardware;url=hardware.htm;target=_self;");
}

drawMenus();

The main menu please place into "embedded_main_menu_2.js" data file:

Code: Select all

with(milonic=new menuname("Main Menu2")){
position="relative";
alwaysvisible=1;
orientation="vertical";
style=menuStyle2;
menualign="left";
itemheight=25;
aI("text=Storage & Data Management;showmenu=Storagesub");
aI("text=Security & Access;url=security.htm;target=_self;");
aI("text=Turn Key & Media Lösungen;url=turnkey.htm;target=_self;");
aI("text=Produktpartner;url=partners.htm;target=_self;");
}

drawMenus();
(Please note Important completion there was
position="relative"; )


There, where you had all the milonic files and the (old) menu_data2.js file before, just place

<script type="text/javascript" language="JavaScript" src="embedded_main_menu_2.js" ></SCRIPT>

and you will see, in FF (Mozilla) and in IE, the menus look very similar, both with the correct itemheight.


Michael
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

thank you... i did it now - i only had to change a few script-tags in your code and now it works...

but the only problem now is that my left menu jumps relative to the size of the middle-table (you know what i mean?)

i tried to fix it with top=125 - but it still jumps - how can i fix my table???

thanks!!
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Padding

Post by Migru »

Hi

I think it is the PADDING in your css file

(in this case padding-left) which causes, that, in a TD cell your menu does not like to be positioned left .................

Michael
Natascha
Beginner
Beginner
Posts: 7
Joined: Thu Jan 05, 2006 11:49 am

Post by Natascha »

hi - i changed my style-sheet : td-> vertical-align=top...

now it works fine!!

THANKS
Post Reply