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

Can a button link to multiple url's?


Poster: fotops
Dated: Thursday May 6 2004 - 5:54:09 BST

I would like to have a link point to two iframes on a page.

One changes the headline art and one changes the content for the page.

So a given "button" would have two url links, each with a "target".

Any chance?

Thanks.


Poster: Ruth
Dated: Thursday May 6 2004 - 6:21:24 BST

I can't really visualize how you'd put two links on one button, how in the world would it know which one was clicked? But, I think you could make a button of two images that you put together so they look like only one. Put them in a little table with border=0, cellpadding=0, cellspacing=0. Then you could link to either side if they meet at the vertical center or in the top and bottom if they meet at the horizontal center. Kind of like an image map? You might also be able to create buttons with css and do the borders in such a way that it looks like one button, but is really two again with the links attached each to it's own.

Ruth


Poster: kevin3442
Dated: Thursday May 6 2004 - 8:06:22 BST

You could make a javascript function that would take two URLs as parameters, then change the content of the two iframes to the two passed urls. Call the function from the menu item.

Cheers,

Kevin


Poster: fotops
Dated: Friday May 7 2004 - 15:50:31 BST

Thanks for your suggestions, I have found some javascript functions for linking to multiple <iframes>'s and by using the "clickfunction" I can integrate a javascript function to show/hide div's (layers).

The possible combinations are limitless!!!

here is some of the coding...

Code for javascript linking to multiple <iframe>'s uses this function:
Code:
function loadFrames(frame1,page1,frame2,page2) {
eval("parent."+frame1+".location='"+page1+"'");
eval("parent."+frame2+".location='"+page2+"'");
}


The code to activate the multi-links is:
Code:
url=javascript:loadFrames('FrameA','http://www.google.com','FrameB','http://www.yahoo.com')

This could easily expand to however many iframes you need!



Milonic's "clickfunction" coding to show/hide div's (layers):
Uses two macromedia dreamweaver functions...
Code:
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

You can activate it with the "clickfunction":
Code:
clickfunction=MM_showHideLayers('LayerA','','hide','LayerB','','show','LayerC','','hide','LayerD','','hide','LayerE','','hide','LayerF','','hide','LayerG','','hide')


Cheers!

fotops


Poster: John
Dated: Friday May 7 2004 - 22:52:56 BST

Always use the [code][/code] tags when posting code. As you can see, your post leaves something to be desired!


Poster: Ruth
Dated: Monday May 10 2004 - 1:11:08 BST

Thanks for posting the information, fotops

Ruth


Poster: Ruth
Dated: Wednesday December 14 2005 - 20:28:48 GMT

Hi fotops,

Not sure if you'll see this, but could you possibly give me an example of this. I'm not real good at using functions. I understand the part about using the clickfunction in the menu aI string. How do I set up the divs on the page so they are not showing and then are called to show with the function?

Ruth