Solved

ckeditor with less width

Posted on 2011-02-21
7
476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 110

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 110

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 110

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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