0

I have an textarea with tinyMCE included in the JQuery dialog.

Here is how I created this:

tinyMCE.init({ mode: 'none', });    
var paragraphDialog = $('#paragraph_dialog');       
$('<textarea/>').attr('id', 'txt_paragraph');
txtAreaParagraph = $('<textarea/>');    
paragraphDialog = $('<div/>').attr('id', 'paragraph_dialog');
txtAreaParagraph.appendTo(paragraphDialog);

paragraphDialog.dialog({
    height: 300,
    width: 800,
    modal: true,
open: function ()
    {
    if ($('#txt_paragraph_parent', $(this)).length == 0)
        {
        var ddd = {mode:'none'};
        txtAreaParagraph.tinymce(ddd);
        }
    };

Now, I would like to set the width attribute of the textarea.

I have tried

$('<textarea/>').css('width', '700px');

and

$('<textarea/>').css('width', '700');

But none of them works.

Thank you very much for your help regarding my problem.

3 Answers 3

1

Try this

txtAreaParagraph = $('<textarea/>');  
txtAreaParagraph.css('width', '700px');
Sign up to request clarification or add additional context in comments.

Comments

0

You need to remove the tags , do :

$('textarea').css('width', '700');

1 Comment

Thank you for your answer ftom2, but this is not changing my problem, I have tryed but nothing changes.
0

Try adding the width parameter to the tinyMCE.init function like so.

tinyMCE.init({width: "800", mode: 'none', });    
var paragraphDialog = $('#paragraph_dialog');       
$('<textarea/>').attr('id', 'txt_paragraph');
txtAreaParagraph = $('<textarea/>');    
paragraphDialog = $('<div/>').attr('id', 'paragraph_dialog');
txtAreaParagraph.appendTo(paragraphDialog);

paragraphDialog.dialog({
    height: 300,
    width: 800,
    modal: true,
open: function ()
    {
    if ($('#txt_paragraph_parent', $(this)).length == 0)
        {
        var ddd = {width: "800", mode:'none'};
        txtAreaParagraph.tinymce(ddd);
        }
    };

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.