Jump to content

[solved] Dynamically change the CKE BG-color in PageEditor?


Recommended Posts

Posted

Hi,

how can I access the CKE background elemet via JS? I need to add / remove css classes to change the bg-color.

Any hints are greatly appreciated.

Posted

Many thanks. I have tried a lot from SO links in the last past 2 hours. But all of them result in 'undefined' objects. In pW PageEditor, the CKE textarea is within an iframe, maybe that is the reason?

Posted

Ok, the culprit was that CKE needs some time on startup to dynamically create the iframes. Therefore all those tries running on document load failed. As a workaround I use setTimeout() with a delay of 1000 ms to start finding the iframes. Will look into CKE API, if there is something that can be queried that indicates ready loaded CKE and use this instead of my workaround.

But for today I'm finished with work. ?

dynamic_cke_bg-color_via_radios.thumb.gif.3ba9ef60863c9e028a3a3a2a45f56f8a.gif

  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...