Click to See Complete Forum and Search --> : what event


Termite
10-02-2003, 06:38 AM
I am using an iframe in edit mode.

When a user points the mouse in a different area I want to return the font so I can update my font list with the current selection.

It works when pressing a button but I need it to work automatically when a user selects another area of the iframe.

See my example code below.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY>
<iframe id=iView name=iView onclick="whatfont()">

</iframe>
<button onclick="whatfont()">Font</button>
<SCRIPT LANGUAGE=JSCRIPT>
alert("Hello")

iView.document.body.innerHTML = "<FONT id=myfont face=Arial Size=2 color=red>Test Font</font>"
iView.document.body.contentEditable = true
function whatfont()
{
thevalue = iView.document.queryCommandValue("fontName")
// alert(iView.document.execCommand('fontname', false))
alert(thevalue)
}
</SCRIPT>
</BODY></HTML>

Thanks!