J
J
Hi,
I'm using the following code snippet to show popup menus (in a header
frame) and target the menu options to another frame. This works fine for
a single hard-coded frame (e.g. "2" below, in doClick) but I need to
pass in the target frame ID when the user clicks, the reason being that
different options will target different frames depending on who the user is.
the target frame name is in the target attribute of the link tag, i.e.
<a href="" target="here"> that the user clicks on but I don't know how
to make use of this in the code below.
Hope that makes sense, can anyone help?
J
function showMenu(linkObj, menuID)
{
var popupObj = window.createPopup();
var popupBodyObj = popupObj.document.body;
popupBodyObj.style.border = "0px black solid";
popupBodyObj.style.color="99ccff";
popupBodyObj.style.hover="red";
popupBodyObj.innerHTML = menuID.outerHTML;
for (var i = 0; i < popupBodyObj.all.length; i++)
{
if (popupBodyObj.all.tagName == "A")
popupBodyObj.all.onclick = doClick;
}
popupObj.show(0, linkObj.offsetHeight+2, menuID.offsetWidth,
menuID.offsetHeight, linkObj);
}
function doClick()
{
parent.frames(2).location = this.href;
return false;
}
I'm using the following code snippet to show popup menus (in a header
frame) and target the menu options to another frame. This works fine for
a single hard-coded frame (e.g. "2" below, in doClick) but I need to
pass in the target frame ID when the user clicks, the reason being that
different options will target different frames depending on who the user is.
the target frame name is in the target attribute of the link tag, i.e.
<a href="" target="here"> that the user clicks on but I don't know how
to make use of this in the code below.
Hope that makes sense, can anyone help?
J
function showMenu(linkObj, menuID)
{
var popupObj = window.createPopup();
var popupBodyObj = popupObj.document.body;
popupBodyObj.style.border = "0px black solid";
popupBodyObj.style.color="99ccff";
popupBodyObj.style.hover="red";
popupBodyObj.innerHTML = menuID.outerHTML;
for (var i = 0; i < popupBodyObj.all.length; i++)
{
if (popupBodyObj.all.tagName == "A")
popupBodyObj.all.onclick = doClick;
}
popupObj.show(0, linkObj.offsetHeight+2, menuID.offsetWidth,
menuID.offsetHeight, linkObj);
}
function doClick()
{
parent.frames(2).location = this.href;
return false;
}