CKEditor loading in Colorbox not working [ Google Chrome ]

前端 未结 1 1155
时光说笑
时光说笑 2021-01-25 11:33

I am using Colorbox in my project. I have integrated CKEditor in colorbox. Its working fine in all browsers, but a small issue in Google Chrome - Editor will open properly on fi

相关标签:
1条回答
  • 2021-01-25 11:51

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

    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

    <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>
    

    Regards

    Nishad Aliyar

    0 讨论(0)
提交回复
热议问题