且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CKEditor在Colorbox中加载不工作[Google Chrome]

更新时间:2023-12-05 19:47:40

我得到了相同的解决方案,只是包括jquery和jquery适配器在index2.html。请参见下面的示例...

I got the solution for the same , just include the jquery and jquery adapter in index2.html. Please see below for example...

index1.html

index1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="../ckeditor/_samples/jquery-1.5.1.min.js"></script>
        <script src="colorbox/jquery.colorbox-min.js"></script>
        <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>
        <script src="../ckeditor/_samples/sample.js" type="text/javascript"></script>

        <link rel="stylesheet" href="colorbox.css" />
        <link href="../ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('a.gallery').colorbox({ opacity:0.5 });
            });
        </script>

        <style type="text/css">

        </style>
    </head>
    <body>
        <a class='gallery' href='index2.html' style="font-size: 30px;">click here for editor</a>
    </body>
</html>

index2.html

index2.html

<script type="text/javascript" src="../ckeditor/_samples/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>

<textarea name="ckeditor_replace" id="ckeditor_replace" class="ckeditor_replace"></textarea>
<script type="text/javascript">
    $(document).ready( function() { // I use jquery
        var instance = CKEDITOR.instances['ckeditor_replace'];
        if(instance)
        {
            CKEDITOR.remove(instance);
        }
        //CKEDITOR.config.startupFocus = true;
        //CKEDITOR.config.startupShowBorders = false;
        //CKEDITOR.config.startupOutlineBlocks = true;
        //CKEDITOR.config.startupMode = 'source';
        $( '.ckeditor_replace' ).val('12345');
        $( '.ckeditor_replace' ).ckeditor(function() {  } );
    });
</script>

尊敬

Nishad Aliyar

Nishad Aliyar