Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Menu IE5.5+

  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Menu IE5.5+

    Is there any way on the Menu IE5.5+ to where if you click on the link it opens in a new window? if so what do i do to get this to work?

    heres my code:

    <script language="javaScript">
    <!--

    ///////////////////////////////////////////////////////////////////////////////
    // ..:: realMenu v1.27 ::..
    // copyright © jordan neill 2000
    // Script featured on JavaScript Kit (http://javascriptkit.com)
    //
    // change the menuItems array with your options and set the urls to link to
    // use addMenuItem("Text to show", "Url To Link To"); to make an item
    // use addMenuItem("Text", Url", "Img To Show"); to make an item with an image
    // use addMenuItem(); to indicate a separator bar
    // you can use html tags in the text, eg, <i>, <b> or <u>
    //
    // images used should be 16x16 transparent gifs
    ///////////////////////////////////////////////////////////////////////////////

    menuItems = new Array();
    menuItemNum = 0;

    function addMenuItem(text, url, img){
    if(img) menuItems[menuItemNum] = new Array(text, url, img);
    else if(text) menuItems[menuItemNum] = new Array(text, url);
    else menuItems[menuItemNum] = new Array();
    menuItemNum++;
    }

    menuWidth = 155; //menu width
    menuHeight = 233; //menu height
    menuDelay = 50; //delay before menu appears
    menuSpeed = 8; //speed which menu appears (lower=faster)
    menuOffset = 2; //offset of menu from mouse pointer

    addMenuItem("<center>BancTec Contract Tool</center>","/bsc/default.asp","/bsc/includes/rightclick3/icons/home.gif");
    addMenuItem();
    addMenuItem("Back","javascript:history.go(-1)","/bsc/includes/rightclick3/icons/back.gif");
    addMenuItem("Forward","javascript:history.go(1)","/bsc/includes/rightclick3/icons/forward.gif");
    addMenuItem("Refresh","javascript:history.go(0)","/bsc/includes/rightclick3/icons/browser.gif");
    addMenuItem();
    addMenuItem("BancTec Dictionary","http://www.cnn.com","/bsc/includes/rightclick3/icons/dictionary.gif");
    addMenuItem("Phone List","http://www.abcnews.com","/bsc/includes/rightclick3/icons/phone.gif");
    addMenuItem("Quick Links","http://www.msnbc.com","/bsc/includes/rightclick3/icons/internet.gif");
    addMenuItem("Support Matrix","http://news.bbc.co.uk","/bsc/includes/rightclick3/icons/notepad.gif");
    addMenuItem("Website Passwords","http://www.cbsnews.com","/bsc/includes/rightclick3/icons/password.gif");
    addMenuItem();
    addMenuItem("MM03 Nouns","http://www.cbsnews.com","/bsc/includes/rightclick3/icons/tool.gif");
    addMenuItem();
    addMenuItem("Updates","http://www.cbsnews.com","/bsc/includes/rightclick3/icons/updates.gif");

    ///////////////////////////////////////////////////////////////////////////////
    // do not edit the code below, it is required for the menu to work correctly
    ///////////////////////////////////////////////////////////////////////////////


    if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
    isIe = 1;
    else
    isIe = 0;

    if(isIe){
    menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';
    for(m=0;m<menuItems.length;m++){
    if(menuItems[m][0] && menuItems[m][2])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
    else if(menuItems[m][0])
    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';
    else
    menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';
    }
    menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';

    menuPopup = window.createPopup();
    menuPopup.document.body.innerHTML = menuContent;
    }

    function showMenu(){
    menuXPos = event.clientX + menuOffset;
    menuYPos = event.clientY + menuOffset;

    menuXIncrement = menuWidth / menuSpeed;
    menuYIncrement = menuHeight / menuSpeed;

    menuTimer = setTimeout("openMenu(0,0)", menuDelay);

    return false;
    }


    function openMenu(height, width){
    iHeight = height;
    iWidth = width;

    menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

    if(iHeight < menuHeight)
    menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);
    else
    clearTimeout(menuTimer);
    }


    if(isIe) document.oncontextmenu = showMenu;


    //-->
    </script>
    Last edited by matrix2280; 01-17-2004 at 03:24 AM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    You are going to have to change the parent.window.location to Window.open commands
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I changed the parent.window.location
    to
    window.open.location

    and it says


    Error: 'window.open.location' is null or not an object

    Is there anyway i could do a target=
    in the URL?

    I tried using a javascript within the URL to open in a new window, but that had no effect.

    Some of the links i want to load in the parent frame, but others i would like to open in a new window.


  •  

    Posting Permissions

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