PDA

View Full Version : AnyLink JS Drop Down Menu v2.2



BuildMyWeb
05-10-2010, 10:05 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:

In the above script, I am trying to edit the submenu that drops-down with individual targets for each link.

for instance, in the following block, i want the .php file to open in the parent window but the other 3 .pdfs to open in a separate tab/window. some help would be much appreciated.


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#DFFDF4', linktarget:'_parent'} //Second menu variable. Same precaution.
anylinkmenu1.items=[
["Why Cleanse?", "why.php"],
["Allergens Table", "forms/allergens_table.pdf"],
["Product Ingredients", "forms/ingredients.pdf"],
["Medical study", "forms/med_study.pdf"]
]

ddadmin
05-11-2010, 06:46 PM
Sure, try the below modified .js file, which lets you specify a link target for each link within a drop down menu individually. With the modified script, inside your menu contents code, make use of the 4th parameter of each link to specify a link target:


var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#DFFDF4', linktarget:'_parent'} //Second menu variable. Same precaution.
anylinkmenu1.items=[
["Why Cleanse?", "why.php"],
["Allergens Table", "forms/allergens_table.pdf", "", "_new"],
["Product Ingredients", "forms/ingredients.pdf", "", "mytarget"],
["Medical study", "forms/med_study.pdf"]

Here the 2nd link will open in a new window, and the 3rd link will open in the window with target "mytarget".