PDA

View Full Version : Anylink Menu - _new



WereAllThieves
07-30-2010, 04:20 PM
1) Script Title: AnyLink JS Drop Down Menu v2.2

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem:
I would like to have one of the links in the menu contents to load in the same page, and the other link to load in a new tab. Any suggestions on how to do this?

kuau
07-30-2010, 06:25 PM
If I am understanding correctly, all you need to do is define the first link normally, and the second one to open in a new page. For example:


var menu1=new Array()
menu1[0]='<a href="/php/about-us.php">About Us</a>'
menu1[1]='<a href="http://www.dynamicdrive.com" target="_blank">Best Scripts</a>'

WereAllThieves
07-30-2010, 06:35 PM
Well, how would that apply to the code from this script?


var link1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
link1.items=[
["Go to Website", "http://www.link1url.com"],
["View the Flyer", "../link1folder/link1.html"]
]

kuau
07-30-2010, 06:45 PM
Seems I am using an older version of the same script. Not sure if this would work... I've enclosed the first link in single quotes in order to add the new page part.


var link1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
link1.items=[
["Go to Website", '"http://www.link1url.com" target="_blank"'],
["View the Flyer", "../link1folder/link1.html"]
]

I just took a look at the new version. Now I remember trying it when it came out. Although it has many cool new features, I found it overkill for my needs. I really like the original version.

nigelgordijk
03-02-2011, 08:09 PM
Thanks for posting your solution. I've tried it, too, but rather than opening the link to another site in a new window, it opens the same page the link appears on in a new window. Any idea why this might be, please? Here's the code:



anylinkmenu.items=[
["CAO Office", "departments-cao-office.php"],
["Castle Kilbride", '"http://www.castlekilbride.ca" target="_new"']
//no comma following last entry!
]

Thanks!

kuau
03-02-2011, 09:42 PM
Try changing the target="_new" to target="_blank"

[Nicolas]
03-02-2011, 09:43 PM
Try changing the target="_new" to target="_blank"

You beat me to it ;P

kuau
03-02-2011, 10:19 PM
Ha ha... you have to be fast around here! :)