Reset focus to hyperlink on XUL dialog

  • Thread starter Samuel Saint-Pettersen
  • Start date
S

Samuel Saint-Pettersen

Hello everyone,

I am having problems with my chromeless pop up window (i.e. no titlebar)
to reset focus to the hyperlink that called it.

I have this code:

<!-- begin JS snippet (external JavaScript file) -->

var popupTip;
function showTip()
{
popupTip = window.open
('tip.xml','popuptip','chrome,titlebar=no,height=50,width=300,centerscreen');
document.getElementById("tip1").focus();
}
function closeTip()
{
popupTip.close();
}

<!-- end snippet -->

As you can see I tried using "document.getElementById.." to regain focus
to the link. But for some reason this does not work.

<!-- begin HTML snippet in XUL dialog -->

<html:a id="tip1" onmouseover="javascript:showTip();"
onmouseout="javascript:closeTip();"
style="text-decoration: none; border-bottom: dotted 1px;">
vB code</html:a>

<!-- end snippet -->

I have given my link an ID, so the above theoretically should work, but
it does not.

Can anyone suggest an alternative method for regaining focus to the link
or highlight any mistakes I may have made which prevents my code
working. Thanks in advance.


Samuel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top