Results 1 to 3 of 3

Thread: Add ability to use target="_blank" to HV Menu

  1. #1
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Add ability to use target="_blank" to HV Menu

    1) Script Title: HV Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...menu/index.htm

    3) Describe problem:
    I would like to add the ability to use the target="_blank", ="_parent", ="_top", ="_self" when selecting a menu item that goes to an 'external' web link.

    Presently, the settings in the "exmplmenu_var.js" file for each menu item are:
    // Menu tree
    // MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
    // For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg"

    Typical Menu item:
    Menu2=new Array("xyz.com News Highlights","http://www.xyz.com/","",0,20,200);

    There is no ability to open a new browser window or tab for the external link, that is called in the above item.
    In HTML, the code for a new window or tab would be:
    <a href="http://www.xyz.com/" target="_blank">"xyz.com News Highlights</a>
    How can I add that ability, and where must it be added? In the both the "exmplmenu_var.js" and the "menu_com.js" files?
    I've been using the HV Menu 5.5 system for 5 years. I really like it better than the CSS menus I've tried.

    I'm not a Java Script programmer, and have no idea where to begin.
    Thank you for any advice or ideas you can offer.
    I appreciate it very much.
    (Rick) Shobuz99

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    That's an old menu and what we call 'third party' (was user submitted) to boot. So we technically don't support it.

    That said, I would try:

    Code:
    Menu2=new Array("xyz.com News Highlights","javascript:window.open('http://www.xyz.com/','_blank')","",0,20,200);
    or:

    Code:
    Menu2=new Array("xyz.com News Highlights","javascript:void(window.open('http://www.xyz.com/','_blank'))","",0,20,200);
    If memory serves this has come up before albeit quite some time ago and one or the other perhaps even either of those did the trick.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    shobuz99 (06-18-2011)

  4. #3
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    That's an old menu and what we call 'third party' (was user submitted) to boot. So we technically don't support it.

    That said, I would try:

    Code:
    Menu2=new Array("xyz.com News Highlights","javascript:window.open('http://www.xyz.com/','_blank')","",0,20,200);
    or:

    Code:
    Menu2=new Array("xyz.com News Highlights","javascript:void(window.open('http://www.xyz.com/','_blank'))","",0,20,200);
    If memory serves this has come up before albeit quite some time ago and one or the other perhaps even either of those did the trick.
    Thank you very much, John. I know it's quite an old menu.
    I noticed that the last time I logged on here was in 2006! I guess that makes the menu at least 5 years old.
    Do you recommend a new menu from here that would make a good replacement and update for the HV Menu I'm using?
    Just wondered.

    BTW... the only problem I ever encountered with the HV Menu, occurred when the IE7 and IE8 browsers came out.
    I had to instruct users of the websites I designed with HV Menu, to use the
    "compatibility view" so that the HV Menu would operate correctly.
    Prior to using "compatibility view", the HV Menu sub-menus, with IE7/IE8,
    would appear at the top of the page, instead of adjacent to the main menu item.
    I was criticized by some programmers for using HV Menu for that reason.
    Do you know of any way that HV Menu could be changed to work better with IE7/IE8, in that regard?
    I value your opinion.
    Thank you again for your help.
    (Rick) shobuz99

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •