Click to See Complete Forum and Search --> : wysiwyg editor and style sheets


esthera
09-02-2003, 01:06 AM
I as trying to make a wysiwyg editor. I use the exec commands of ie 5+

To change the font I now do it as the following

function doFont(fName)
{
if(fName != '')
iView.document.execCommand('fontname', false, fName);
}

the selected font list look like this:

<select name="selFont" onChange="doFont(this.options[this.selectedIndex].value)">
<option value="">-- Font --</option>
<option value="Arial">Arial</option>
<option value="Courier">Courier</option>
<option value="Sans Serif">Sans Serif</option>
<option value="Tahoma">Tahoma</option>
<option value="Verdana">Verdana</option>
<option value="Wingdings">Wingdings</option>
</select>


I want to change this to use stylesheets. The text I am changing is in an Iframe?
Any ideas?

cul8er23
09-02-2003, 03:25 AM
I am not sure if this will work, you can try something like that:

iView.document.style.font-family= fName;
or
iView.document.style.font ="bold 12pt "+fName; //IE

iView.document.style.setAttribute("font-family", fName, "false");
or
iView.document.style.setAttribute("font", "bold 12pt "+fName, "false"); //NAV

// maybe re-interprete HTML by (thanks to Khalid ;) )
iView.document.innerHTML = iView.document.innerHTML;

Hope I could help

Cheers
Fab