如何使用tinymce设置textarea的宽度? [英] How to set the width of textarea using tinymce?

查看:105
本文介绍了如何使用tinymce设置textarea的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了几种方法来设置tinymce textarea的宽度.

I tried a several methods to set the width of the tinymce textarea.

我的第一次尝试:

height: '200px',
width: '220px'   // inside tinyMCE.init({

在第二次尝试中:

<textarea name="editorial" cols="40" rows="20" id="editorial" style="width: 40em; height: 20em"><?=$row['editorial']?></textarea>

但是,我仍然无法按照我的要求获得宽度.

But still, I am not able to get the width as per my requirement.

有什么想法吗?

推荐答案

我认为问题可能出在您的 TinyMCE init 函数中的工具栏上.

I think the problem may be with the toolbars in your TinyMCE init function.

试试这个例子,让我知道它是否适合你?

Try this example, and let me know if it works for you?

在您的 HTML 中:

in your HTML:

<textarea name="editorial" class="test" cols="40" rows="20" id="editorial" > editorial</textarea>

然后在你的 JavaScript 中使用这个 tinyMCE.init:

then use this tinyMCE.init in your JavaScript:

    tinyMCE.init({
        // General options
        mode: "textareas",
        theme: "advanced",
        width: "300",
        height: "200",

        // Theme options
        theme_advanced_buttons1: "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull",
        theme_advanced_buttons2: "",
        theme_advanced_buttons3: "",
        theme_advanced_buttons4: "",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_resizing: false,

    // Selector
        editor_selector: "test",

});

这对你有用吗?

这篇关于如何使用tinymce设置textarea的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆