博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
flext_Flext:MooTools自动增长Textrea插件
阅读量:2520 次
发布时间:2019-05-11

本文共 2416 字,大约阅读时间需要 8 分钟。

flext

This post was authored by .

该帖子由撰写。

A while back David Walsh published a list of which included 'AutoGrow' a text area expander plugin. 'AutoGrow' is very similar in results to the class I wrote for Education.com, Flext. I decided to release this code as 'AutoGrow' has a few things I don't like (mostly the flashing the scroll bars while growing, no max height, and the way it watches the textareas 3 times a second). Flext also has a few additional features:

不久前,David Walsh发布了上的的列表,其中包括“ AutoGrow”文本区域扩展器插件。 “ AutoGrow”的结果与我为Education.com Flext编写的课非常相似。 我决定发布此代码,因为“ AutoGrow”有一些我不喜欢的东西(主要是在增长时闪烁滚动条,没有最大高度,以及每秒观看文本区域3次的方式)。 Flext还具有一些其他功能:

  • Grows text areas when needed

    在需要时增加文本区域
  • Can set a max height to grow to

    可以将最大高度设置为
  • Can grows parents if they have a fixed height

    身高固定可以成长父母
  • Ghost text/text overlay for input context and help

    用于输入上下文和帮助的Ghost文本/文本覆盖
  • Text input emulation (enter can submit form, instead of new line)

    文本输入仿真(输入可以提交表单,而不是换行)

用法 (Usage)

I wrote Flext so that our designers and other engineers can easily use these features with just a few class names. The classes used by Flext are:

我写了Flext,以便我们的设计师和其他工程师只需几个类名就可以轻松使用这些功能。 Flext使用的类是:

  • flext - The class needed for the class to find this text area

    flext-类找到该文本区域所需的类

  • growme - Automatically grows the text area

    growme-自动扩大文本区域

  • maxheight-[num] - The max height to grow (in pixels)

    maxheight- [num] -要增长的最大高度(以像素为单位)

  • growparents - Grows the parent elements if needed

    growparents-如果需要,增加父元素

  • stopenter - Stops the enter key from making a newline

    stopenter-阻止回车键换行

  • entersubmits - Submit the form when enter is pressed

    entersubmits-按下回车键提交表单

  • replaceghosttext - Tries to use the ghosted text features (requires a few additional things)

    replaceghosttext-尝试使用幻影文本功能(需要一些其他事项)

For instance to create a basic growing textarea all you have to do is:

例如,要创建一个基本的不断增长的文本区域,您要做的就是:

A max height can be set by using a class name as well:

也可以通过使用类名来设置最大高度:

The above example grows to 200px then behaves like a normal textarea.

上面的示例增长到200px,然后表现得像普通的textarea。

笔记 (Notes)

There are a few things with Flext which could be improved: one is that the textareas do not shrink (it was considered unnecessary for our uses), the other is that to use the ghosted text features requires some non valid html. I can fix these problems if there is enough demand.

Flext有一些可以改进的地方:其一是textareas不会收缩(对于我们的使用而言,这是不必要的),其二是使用重影的文本功能需要一些无效的html。 如果有足够的需求,我可以解决这些问题。

翻译自:

flext

转载地址:http://mcpwd.baihongyu.com/

你可能感兴趣的文章
个人项目:WC
查看>>
地鼠的困境SSL1333 最大匹配
查看>>
flume+elasticsearch+kibana遇到的坑
查看>>
【MM系列】在SAP里查看数据的方法
查看>>
C#——winform
查看>>
CSS3 transform制作的漂亮的滚动式导航
查看>>
《小强升职记——时间管理故事书》读书笔记
查看>>
Alpha 冲刺(3/10)
查看>>
Kaldi中的Chain模型
查看>>
spring中的ResourceBundleMessageSource使用和测试示例
查看>>
css规范 - bem
查看>>
电梯调度程序的UI设计
查看>>
转自 zera php中extends和implements的区别
查看>>
Array.of使用实例
查看>>
【Luogu】P2498拯救小云公主(spfa)
查看>>
如何获取网站icon
查看>>
几种排序写法
查看>>
java 多线程的应用场景
查看>>
dell support
查看>>
转:Maven项目编译后classes文件中没有dao的xml文件以及没有resources中的配置文件的问题解决...
查看>>