Hello,
I am writing a software that uses FCKEditor and I want it to have the following functionality:
When the user focuses an FCKEditor textarea, I want it to resize to a specific height. When the textarea loses the focus, I want its height to shrink to another (smaller) value. Defining the onblur and onfocus events for my textareas-to-be-replaced doesn't (certainly) work since FCKEditor replaces those with IFRAMEs.
Please, if anyone can assist, I'd be really grateful. Thanks a lot in advance.
Best,
Areg
I am writing a software that uses FCKEditor and I want it to have the following functionality:
When the user focuses an FCKEditor textarea, I want it to resize to a specific height. When the textarea loses the focus, I want its height to shrink to another (smaller) value. Defining the onblur and onfocus events for my textareas-to-be-replaced doesn't (certainly) work since FCKEditor replaces those with IFRAMEs.
Please, if anyone can assist, I'd be really grateful. Thanks a lot in advance.
Best,
Areg

Re: FCKEditor Javascript Resize area question
Re: FCKEditor Javascript Resize area question
var o_editor = FCKeditorAPI.GetInstance('FCKeditor1') ;
o_editor.EditorWindow.parent.frameElement.height=700;
IE doesn't like the "EditorWindow.parent" part, so we have to find another way to access it.
-Dan
Re: FCKEditor Javascript Resize area question
-Dan
Re: FCKEditor Javascript Resize area question
I wanted to make my FCKEditor areas shrink and expand upon focus changes. Namely, when a focus would be lost, the area would shrink and expand when getting the focus back.
Here is a small script that works both under Firefox and IE.
function FCKeditor_OnComplete(instance) { instance.Events.AttachEvent('OnBlur', FCKeditor_OnBlur); instance.Events.AttachEvent('OnFocus', FCKeditor_OnFocus); } function FCKeditor_OnBlur(instance) { var ifrm = document.getElementById(instance.Name + '___Frame'); ifrm.height = '60'; // small size } function FCKeditor_OnFocus(instance) { var ifrm = document.getElementById(instance.Name + '___Frame'); ifrm.height = '250'; // large size }Might seem like some sort of a hack, but resize is done almost perfectly. Enjoy.