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

Show/Hide div layers using menu


Poster: bdaltilio
Dated: Friday September 22 2006 - 15:40:17 BST

I am trying to show and hide layers on a page by clicking on a menu item. See http://tempsite.texwipe.com/layer.asp for a example using javascript.

I would prefer to do it with milonic like the tramline menu. Is it possible and if so how?

Thanks


Poster: Ruth
Dated: Saturday September 23 2006 - 6:50:54 BST

Hi,

You can call a function in an aI string. I am not into functions but I can give you a couple of examples so you can see how it's done.

1. This will play a sound when you mouseover an item, in this one it requires that you put a dummy span on the page itself, since that is necessary for the function to work. Put this on an html page.
Code:
<span id=dummyspan></span>


You can put this function either on the page or at the top of the menu_data.js file. If it's in the file, it will work on any page with the dummy span on it, if it's on the page it will only work on the pages where the function is.

Code:
function DHTMLSound(surl) {
  document.getElementById("dummyspan").innerHTML=
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}


Then in the aI string you call the function like this,

Code:
aI("text=Home;url=http://www.milonic.com/;onfunction=DHTMLSound('success.wav');");


In this case the function will fire on mouseover. If you wanted it to work onclick, you could put in
Code:
clickfunction=DHTMLSound('success.wave');");


Here are a couple of demos on the Milonic site, one for putting a new item image based on a date, the other for changing the text of an item based on mouseover.

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

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

Hope this will give you some idea how to do it. I tried it, but since I don't know functions I just keep getting an error return something is outside function :?

Ruth