views:

184

answers:

1

I am using a jquery based rich text editor "lwRTE"

It works well in all ways except in changing fontsize

I traced the problem as follows:

when i change the font size the command and the argument is chosen correctly as "font size" and "[the font size in number Eg.6]"

now the execCommand is executed and chrome executes it differently.

firefox changes the selected text as

 <font size="6px">sample text</font>

chrome changes the selected text as

<span class="Apple-style-span" style="font-size: xx-large;">sample text</span>

this is what causes the problem. when i edit and save using Chrome, firefox seems to not understand the above way of formatting.

how do i make chrome also do the same? (i.e) insert font tag and insert crazy font sizes.

Thanks in advance

+1  A: 

See the compatibility charts for execCommand at http://quirksmode.org. Internet Explorer doesn't support font-size changing at all, Opera and Firefox wrap the font tag and Safari/Chrome behave as you suggested.

You can't change this functionality, you would have to build an alternative that works with the current selection range to implement one x-browser compatible method.

Andy E
thanks.. now restricted font size options to 6. If it goes beyond 7 chrome starts using webkit which creates problems
ZX12R