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:30

How to turn off scrolling menus?


Poster: gsl1 __at__ erols.com
Dated: Sunday August 12 2007 - 15:57:20 BST

I have created a vertical scrolling menu with on and off images and overlying text. The menu works as I expect it to. I am trying to programatically make the scrolling menu invisible and then visible again.

I can do this perfectly with a combination of menuDisplay(getMenuByName(inMenus[i]), 0); (closeAllMenus does not work for me) and popup(inMenus[i], 1); for invisible and visible respectively where the menu names I am controlling are in the javascript inMenus array AND followscroll is set to 0---off. If I set followscroll to 1---on, then the menus turn off for a split second and then they appear again at the top of the browser window and then scoll down to their original location and stop as if I never tried to turn them off.

Is there some way that I can make scrolling menus invisible and visible again programatically?

If not, is there some way that I can programatically move the scrolling menus off screen and then move them back when I need to make them visible again?

-=> Gregg <=-


Poster: Ruth
Dated: Monday August 13 2007 - 3:44:30 BST

Hi,

You said 'menu array' if that is correct, you are using V3 of the menu which is no longer supported. That version as been dead for about 3 years now and none of us remember anything about how to do what in it. You will need to upgrade to version 5. You can get an eval copy on the main site if you wish to test it, and under the DHTML Menus link look toward the bottom and you will see a Conversion tool to convert your menu_array.js file to a version 5 menu_data file using your information. Note that is the menu_array, not the program file.

If you are using Version 5, we will need a page with the menu on it to see what's going on and figure out how to help you.

Ruth

Re: How to turn off scrolling menus?


Poster: gsl1 __at__ erols.com
Dated: Tuesday August 14 2007 - 1:10:40 BST

Quote:
You said 'menu array' if that is correct, you are using V3...


I'm using version 5.778 of Milonic DHTML Menu.

The menu array I'm using is just an array that I created in Javascript to hold the names of the menus I'm manipulating. It has nothing to do with any Milonic menu data structure.

I did not include any code, since I felt the problem I'm having is generic to any menu that has followscroll=1. However, since you requested a concrete example, I have created a small version of the menu I'm working with. You will need to substitute some dummy images for my three images in the menu to have a full working menu:

bgimage="../../images/pencilYellowOn.gif";
overbgimage="../../images/pencilRedOff.gif";
image=../../images/best2006.jpg;

The question I'm asking is: How can I programatically turn off---make invisible---a menu that has followscroll=1?

To date I have only been able to turn a menu on or off that has followscroll=0 by using the following two pieces of javascript code (extracted from a javascript function that is tied to a button click in the page):

Turn them off:
menuDisplay(getMenuByName("leftSide", 0);
menuDisplay(getMenuByName("rightSide", 0);

Turn them on:
popup("leftSide", 1);
popup("rightSide", 1);

The example menu code is shown below.

// NOTE: If you change any of these menus, you must also change the text menus
// used in the disabled Javascript case.

fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps

if(navigator.appVersion.indexOf("MSIE 6.0")>0)
{
effect="Fade(duration=0.2);Alpha(style=0,opacity=100);Shadow(color='#0A4F00', Direction=120, Strength=17)";
}
else
{
effect="Shadow(color='#996633', Direction=35, Strength=10)";
}
function openAnIFrame(inIFrameId, inNewLink) {
var theLinkElement=document.getElementById(inLinkId);
theLinkElement.href=inNewLink;
openIFrame(inIFrameId,inNewLink);
}
if(navigator.userAgent.indexOf("Netscape6/6.2.3")>0)
{
suboffset_left=-167;
}

_menuCloseDelay=500;
_menuOpenDelay=150;
_scrollAmount=3;
_scrollDelay=20;
_followSpeed=3;
_followRate=50;
_subOffsetTop=5;
_subOffsetLeft=0;

with(Style1=new mm_style()){
borderwidth=0
//offbgcolor="none";
//onbgcolor="none";
onborder="none";
offborder="none";
fontstyle="normal";
fontweight="normal";
fontsize="7pt";
//offcolor="#001f0e";
//offcolor="#086131";
oncolor="yellow";
offcolor="red";
itemheight="19px";
itemwidth="212px";
separatorcolor="transparent";
separatorsize=2;
padding="0 0 0 42pt";
bgimage="../../images/pencilYellowOn.gif";
overbgimage="../../images/pencilRedOff.gif";
}

with(milonic=new menuname("leftSide")){
top=155;
left=10;
style=Style1;
alwaysvisible=1;
followscroll=1; // won't undisplay menu, if set to 1.
aI("separatorsize=50;")
aI("status=Back To Home Page;text=2 — HOME;url=http://www.milonic.com/;");
}


with(Style2=new mm_style()){
borderwidth=0
onborder="none";
offborder="none";
separatorcolor="transparent";
separatorsize=2;
}


with(milonic=new menuname("rightSide")){
screenposition="right";
top=155;
//left=500;
itemwidth=177;
style=Style2;
alwaysvisible=1;
followscroll=1; // won't undisplay menu, if set to 1.
aI("separatorsize=50;")
aI("image=../../images/best2006.jpg;imagealign=center;url=http://www.milonic.com/;status=abc;separatorsize=10;borderwidth=0")
}

drawMenus();


Poster: Ruth
Dated: Tuesday August 14 2007 - 1:38:17 BST

Hi,

Sorry, the old version 3 had a data file called menu array :)

Well, I'm not sure I know what you want, unfortunately there is no one on the forum anymore who does js functions, but it sounds like you want to 'toggle' the menu. There is a demos page, the top part of which contains a set of demos created, mostly, by Kevin to help people who wanted things that required some kind of function. There is one called Change Menu Properties.

Demos page - contains other demos

http://support.milonic.com/demos/

change Menu Properties page

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

At the bottom area of the Change Menu Properties page is a text link to more demos. The first property listed on that more demos page is Alwaysvisible, which you can turn off by clicking. I put the page together using the function Kevin did, but since I don't know how to do functions I had to set it up so that the function call was on the page not in the menu like the orientation function is on the first page of the demo.

Hopefully this can be of some help for you.

Ruth


Poster: gsl1 __at__ erols.com
Dated: Tuesday August 14 2007 - 12:27:10 BST

Thank you Ruth!

I found the piece of Javascript code that I needed in the example that you mentioned, modified it to use the properties I wished to change and the menu is now toggling on and off with a mouse click even when it is set as a scrolling menu. I added the following code to my existing code to toggle it on and off respectively:

On:
mm_changeMenuProperty(inMenus[i], 7, 1);
mm_changeMenuProperty(inMenus[i], 19, 1);

Off:
mm_changeMenuProperty(inMenus[i], 7, 0);
mm_changeMenuProperty(inMenus[i], 19, 0);

The 7 references the alwaysvisible property and the 19 references the followscroll property.

I obtained these property numbers from this page:
http://www.milonic.com/menuproperties.php

Note that it is not absolutely perfect. If you scroll down to the bottom of a long page, the page still acts like it has scrolling turned on (scrolls back up slightly if you go past a point at the bottom of the page, but still displays the page bottom; I suspect that I have to turn off some other property as well to stop this behavior), but the menus ARE gone and the behavior exhibited is not a problem for me, so I'm quite pleased.

Also, thank you for pointing out the link to these additional demos. I was unaware of them and I'm sure that they'll be helpful going forward. You might consider adding this demo link to your list of links in your signature.

-=> Gregg <=-

How to turn off scrolling menus?


Poster: gsl1 __at__ erols.com
Dated: Monday September 10 2007 - 23:19:14 BST

Just an update. Shortly after discovering the less than perfect method that I described in the previous post, I found what I believe is a superior method to turn menus on and off. The new method does not require access to any internal menu function calls and does not suffer from the bouncing problem previously described.

To turn a menu off simply use the following JavaScript code:

document.getElementById("menu" + getMenuByName("myMenu1")).style.display="none";

To turn it on use:

document.getElementById("menu" + getMenuByName("myMenu1")).style.display="block";

The getMenuByName("myMenu1") function call maps the menu name that you used for your menu when you specified it in menu_data.js as with(milonic=new menuname("myMenu1")){ ... to an internal Milonic menu number. We then concatenate this with "menu" to form the internally assigned HTML id of your menu. Now we access the menu element with document.getElementById("menu" + getMenuByName("myMenu1")). Finally, we take the resulting element and assign its display style to either "none" with document.getElementById("menu" + getMenuByName("myMenu1")).style.display="none" to eliminate the menu completely including any space taken up by the element or to "block" with document.getElementById("menu" + getMenuByName("myMenu1")).style.display="block" to make it reappear and readjust the layout accordingly.

The block display style must be used, because Milonic puts its menus in span HTML elements which are normally inline, not block.

-=> Gregg <=-

Re: How to turn off scrolling menus?


Poster: Ruth
Dated: Tuesday September 11 2007 - 22:47:53 BST

Hi Greg,

Thanks so much for posting this information. It is greatly appreciated :)

Ruth