PDA

View Full Version : Anylink Menu Open Only Some Items in New Window



dmwhipp
09-24-2013, 11:47 AM
1) Script Title: AnyLink JS Drop Down Menu v2.3

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

3) Describe problem: I have the menu customized and installed on a test page (http://www.flimpact.org/amp/overviewabout.html) and it's working, but I would like to have some items open in a new window and others open in the same window. I did this before with a previous version of this menu thanks to John Scheuer's help, but don't how to change the anylink.js script so I can do this for version 2.3.

Thanks,
Deborah

jscheuer1
09-24-2013, 05:46 PM
Use this version of the script (modified from your copy of it, right click and 'Save As'):

5237

It will allow you to specify the target for individual items in the menucontents.js file:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.items=[

["Program Fact Sheet", "/amp/pdf/2013-AMPFactSheet.pdf"],
["Service Flow Chart", "/amp/index.html", "_blank"],
["Steps to Becoming a Provider", "/amp/index.html"],
["All FAQ's", "/amp/index.html"],
["Sample Menus", "/amp/index.html"],
["Sitemap", "/amp/index.html"] //no comma following last entry!
]



You can still set the linktarget, like if you want all but one or two to open in a new tab:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:'_blank'} //First menu variable. Make sure "anylinkmenu1" is a unique name!
anylinkmenu1.items=[

["Program Fact Sheet", "/amp/pdf/2013-AMPFactSheet.pdf"],
["Service Flow Chart", "/amp/index.html"],
["Steps to Becoming a Provider", "/amp/index.html"],
["All FAQ's", "/amp/index.html", "_self"],
["Sample Menus", "/amp/index.html"],
["Sitemap", "/amp/index.html"] //no comma following last entry!
]



In that scenario, all will open in a new tab, except the All FAQ's page, which will open in the same window.

dmwhipp
09-25-2013, 04:23 PM
Thanks so much for your help again John - working perfectly as usual!
Deborah