gpt4 book ai didi

php - 无法使用 fancybox 输入 CKeditor

转载 作者:搜寻专家 更新时间:2023-10-31 21:42:53 25 4
gpt4 key购买 nike

这是我用于在我的 cakephp 项目中实现 CKeditor 编辑版本的代码。

<div style='display:none'>
<div class="umsg_div" id="umsg_div">
<?php
echo $this->Form->create('Inbox',array('action'=>'private_message_reply','id' => 'form_umsg'));
?>

<ul >
<?php echo $this->Form->input('Inbox.to_id',array('type'=>'hidden','value'=>@$message_details['Inbox']['from_id'],'id'=>'to_id')); ?>
<li><div class="blue_title">Send Private Message</div></li><br/>
<li>Subject</li>
<li><?php echo $this->Form->input('Inbox.subject',array('type'=>'text','class'=>'subject','label'=>false));?></li><br/>
<li>Message</li>
<li>
<?php echo $this->Form->input('Inbox.message',array('type' => 'textarea','id'=>'user_message','rows'=>"2",'style'=>'width:130%','label'=>false));?>
<script language="javascript" type="text/javascript">
if (CKEDITOR.instances['user_message']) {
CKEDITOR.instances.user_message.destroy();
}
CKEDITOR.replace( 'user_message',{
toolbar : 'Basic',
});

</script>
</li>
<li style="text-align:right;padding:10px;"><input type="submit" name="umsg" value="Send" class="normal_button"/> or <a href="#" onclick='return hide_reply();'>Cancel</a></li>
</ul>
<?php echo $this->Form->end(); ?>
</div>
</div>

我在我的项目中的很多地方都使用了 ckeditor...但是在这个地方我不能输入文本字段。

最佳答案

基本上 DOM 事件正在被覆盖,所以您需要做的是在 afterLoad 上使用 setTimeout 来解决问题:

$("#id_of_fancybox_thingy").fancybox({

//all your existing stuff goes here...

afterLoad:function(){
setTimeout(function(){

if (CKEDITOR.instances['elementname']) {
CKEDITOR.instances['jelementname'].destroy();
delete CKEDITOR.instances['elementname'];
}
CKEDITOR.replace('elementname', { "toolbar": [ [ "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Print" ], [ "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" ], [ "\/" ], [ "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" ], [ "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote" ], [ "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" ], [ "Link", "Unlink", "Anchor" ], [ "\/" ], [ "TextColor", "BGColor" ], [ "Maximize", "ShowBlocks" ] ], "height": "200", "width": "690" });

}, 1000);
}

});

关于php - 无法使用 fancybox 输入 CKeditor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8293716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com