简体   繁体   中英

OnMouseOver event in CKEditor

I use the WYSIWYG editor CKEditor. I have a div element that has an onMouseOver attribute but when it is in the editor, my onMouseOver attribute change in data-cke-pa-onmouseover. I searched but I found nothing. Do you know how to make my onMouseOver attribute is not changed?

my div in the editor:

<div id="253" class="data-video" data-cke-pa-onmouseover="CKEditorHoverVideo('id', true)">

desired code:

<div id="253" class="data-video" onmouseover="CKEditorHoverVideo('id', true)">

CKEditor secures a lot of things when parsing the content that it gets. It secures element events (like onclick ), javascript ( <script> wrapped in <!-- ... --> ), iframes etc. just make sure they don't break editor internals, which is, of course undesired.

You have to attach your JavaScript events after editor contents are loaded (ie contentDom or setData , afterPaste events) to get it working. Most likely, you should develop your own plugin that automates this process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM