Solved

ckeditor with less width

Posted on 2011-02-21
7
472 Views
Last Modified: 2012-08-13
the standard ckeditor is 800px
it can be shrunk by dragging the bottom right corner

is there a way to drag the right corner by default and make it less width
0
Comment
Question by:rgb192
  • 3
  • 3
7 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
You mean to set the width to a smaller size without dragging the corner?  I don't quite understand "drag the right corner by default"
0
 

Author Comment

by:rgb192
Comment Utility
ckeditor is very wide
I want it to be narrow in width

<text area style="width:400px height:100px; ">
words go here
</text area>

I can change height, but not width by using code


the only way I know of changing width is to resize the ckeditor using the browser
0
 
LVL 3

Expert Comment

by:dagaz_de
Comment Utility
This will help you:

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.width

Defined in: core/config.js.

you can config the width, f.e.:

config.width = 850;

or you do it with Javascript after replacing the Textarea:

This this:

CKEDITOR.replace( 'editor1',
    {
        toolbar : 'Basic',
        uiColor : '#9AB8F3'
        config.width = 850;
    });

or this:

CKEDITOR.config.width  = 850;
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:rgb192
Comment Utility
addding

echo'
<script type="text/javascript">
CKEDITOR.replace( \'editor1\'),
    {
        toolbar : \'Basic\',
        uiColor : \'#9AB8F3\'
        config.width = 150;
    });
</script>';

produced no change

are you sure the
,
and
;
are in the correct place
echo'
  <textarea name="body" style="width:200px; height:100px;">'.$a['pdescription'].'</textarea>';

echo'      
<script type="text/javascript">
CKEDITOR.replace( \'body\' );
</script> 
';    
echo'
<script type="text/javascript">
CKEDITOR.replace( \'editor1\'),
    {
        toolbar : \'Basic\',
        uiColor : \'#9AB8F3\'
        config.width = 150;
    });
</script>';

Open in new window

0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
That .replace thing might be missing a comma after the end of the uiColor line.  But I think I would just follow this example:
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.width
0
 

Author Closing Comment

by:rgb192
Comment Utility
thanks
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Thanks for the points.  I have plenty and do not mind if you share some with @dagaz_de.

All the best, ~Ray
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now