Results 1 to 2 of 2

Thread: window.open.href=

  1. #1
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb window.open.href=

    I'm trying to create a tab for facebook, with links that will "break out of frame". (fyi, I'm converting a page to fit the tab)
    I'm not well versed in .js so this is tough for me, I've literally spent days trying to learn and figure this out.

    What I have done, is gotten the main link to open in a new window by changing; onclick="document.location.href=' // to // onclick="window.open.href='
    Code:
    <td id="menu1" onclick="window.open.href='http://www.thelink.com/whateva/';" onmouseover="this.style.cursor='pointer'" width="100"><strong><span style="font-family: Arial, Helvetica, sans-serif; color: #666666;">&nbsp;<a class="menu" href="http://www.thelink.com/whateva/">What Eva</a></span></strong></td>
    but the links(written in .js) for the drop down do not open in a new window.
    Code:
    var menu1 = ms.addMenu(document.getElementById("menu1"));
    		menu1.addItem("first link", "/store/home.php?cat=24");
    		menu1.addItem(" second", "/store/home.php?cat=22");
    		menu1.addItem("third", "/store/home.php?cat=1");
    		menu1.addItem("4th and so on", "/store/home.php?cat=2");
    		menu1.addItem("<table cellpadding=0 cellspacing=0><tr cellpadding=0 cellspacing=0><td width=139px  cellpadding=0 cellspacing=0></td></tr></table>", "#");
    Drop down menu
    Code:
    function item_click() {
    if (!animating) {
    if (_this.items[this._index].url) 
    location.href = _this.items[this._index].url;
    }
    }
    
    in the dropdownC.js
    If you could help I'd be GRATEFUL!!

    Thanks, Jeff
    Last edited by Kastlebrick; 06-13-2011 at 04:35 PM.

  2. #2
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    figured it out

    function item_click() {
    if (!animating) {
    if (_this.items[this._index].url)
    location.href = _this.items[this._index].url;
    }
    }
    location.href = _this.items[this._index].url;
    change to;
    window.open(_this.items[this._index].url, '', '');;

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
  •