Solved

ckeditor with less width

Posted on 2011-02-21
7
474 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 109

Expert Comment

by:Ray Paseur
ID: 34944886
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
ID: 34944998
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
ID: 34945280
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:rgb192
ID: 34945463
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 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 34945657
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
ID: 34946486
thanks
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 34946522
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

775 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