我在同一页面中有两个CKEditor。我想藏其中之一。我怎样才能做到这一点?

时间:2019-12-28 09:22:59

标签: jquery django ckeditor4.x

我正在将CKEditor与Jquery插件一起使用。加载HTML页面时,我显示了2个编辑器。我只需要显示1个编辑器并想要隐藏一个(Ckeditor)。

    <script>
        $(document).ready(function () {
            $('form.sms-comm-template').on('submit', function (elem) {
                elem.preventDefault();
                $.ajax({
                    url: $(this).attr('action'),
                    type: $(this).attr('method'),
                    dataType: 'json',
                    data: $(this).serialize(),
                    success: function (data) {
                        $('#comm-update').css({'display': 'none'});
                        $('#Communication').css({'display': 'block'});
                        CKEDITOR.replace( 'editor1' );
                        $('.template_body').each(function(e){
                            CKEDITOR.replace( this.id,                                
                                { scayt_autoStartup : true, },
                                display: none,);
                        });
                    },
                    error: function (xhr, err) {
                    }
                });
            })
        });
    </script>

0 个答案:

没有答案