PDA

View Full Version : window.open.href=



Kastlebrick
06-13-2011, 01:32 PM
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='

<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.

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

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, :confused:Jeff

Kastlebrick
06-13-2011, 04:32 PM
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, '', '');;