Change Background CKEditor

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
Danny
User
Posts: 139

Change Background CKEditor

Post by Danny »

Hi,

Can you tell me how to change the background color from the CKEditor.

$('#x_<field>').css({'background-color':'#FFE6E6'}); <--- this is not working .

Regards,


vincenthung
User
Posts: 88

Post by vincenthung »

If you want to change the background of input area, you can customize the content.css inside the ckeditor folder.

update the background-color: #fff to #FFE6E6.


Danny
User
Posts: 139

Post by Danny »

Hi,

We want to modify the background-color of input area on the fly. Not the content.css inside the ckeditor folder.

Example:

If the field input area of the ckeditor is empty then the background-color is red (required).
If the field input area of the ckeditor is NOT empty then the background-color is transparant.

Regards, Danny


vincenthung
User
Posts: 88

Post by vincenthung »

You need to select the Body element inside the iFrame of CKEditor. Please try:

$(".cke_wysiwyg_frame").contents().find(".cke_editable").css("background-color","#FFE6E6");


Danny
User
Posts: 139

Post by Danny »

Hi,

This code is not working. Do you have an other solution ?

Here some code with inspect.

<iframe tabindex="0" title="Tekstverwerker, x_Gespreksverslag, Druk ALT 0 voor hulp" class="cke_wysiwyg_frame cke_reset" aria-describedby="cke_51" src="javascript:void(function(){document.open()%3B(function()%7Bfor(var%20a%3B%3B)try%7Ba%3Dwindow.parent.document.domain%3Bbreak%7Dcatch(f)%7Ba%3Da%3Fa.replace(%2F.%2B%3F(%3F%3A%5C.%7C%24)%2F%2C%22%22)%3Adocument.domain%3Bif(!a)break%3Bdocument.domain%3Da%7Dreturn!!a%7D)()%3Bdocument.close()%3B}())" frameborder="0" style="width: 100%; height: 100%;" allowtransparency="true"></iframe>

Regards,


Post Reply