Jquery自动调整字体大小

时间:2014-01-06 21:07:50

标签: jquery ruby-on-rails coffeescript

我正在使用this plugin来自动调整文本框的大小。它运行良好,直到我尝试在我的CSS中添加字体大小。在.js文件中,我看到一些叫做排版样式的东西,但我不确定如何设置它们。

jquery.autosize.js:

typographyStyles = [
    'fontFamily',
    'fontSize',
    'fontWeight',
    'fontStyle',
    'letterSpacing',
    'textTransform',
    'wordSpacing',
    'textIndent'
],

我的coffee.js文件如下所示:

$(document).ready ->
  $("textarea").autosize()

此表单的输入文本是我正在尝试更改的文本:

<%= f.input :title, as: :text, input_html: { :class => "create" }, label: false,placeholder: "Title" %>

css .create:

.create {

border: 0px solid white !important;
resize: none;
padding: 0px !important;
margin: 0px !important;
font-family: 'Roboto', sans-serif;
width: 100% !important;
}

font-size有效,但文本框调整大小不会。

0 个答案:

没有答案
相关问题