【问题标题】:Bootstrap TextArea is NOT re-sizable in IE11Bootstrap TextArea 在 IE11 中不可重新调整大小
【发布时间】:2016-12-21 23:06:22
【问题描述】:

我正在 ASP.NET 中实现一个 MVC Web 应用程序。

生成视图,给我

@Html.EditorFor(model => model.Bio, 
                         new { htmlAttributes = new { @class = "form-control" } }
)

我想要TextArea所以我把它改成了

@Html.TextAreaFor(model => model.Bio, 
                  new { htmlAttributes = new { @class = "form-control" } }
)

问题是文本区域在 IE11 中无法调整大小。 在 Chrome、FireFox 和 Opera 上没有问题。

我也试过解决办法:This Q/A

请指教。

【问题讨论】:

    标签: javascript asp.net-mvc twitter-bootstrap internet-explorer-11


    【解决方案1】:

    对文本区域使用 jQueryUI Resizable。

    在您的项目中包含 jQuery UI 库

    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    

    然后在您的 jquery 代码中调用下面的行

    $("#MyTextAreaId").resizable({ });
    

    【讨论】:

    • 它不工作。我添加了“@section MyCustomScripts {
    • 这是我的代码:~{ ViewBag.Title = "Edit"; } ~section MyCustomScripts{ } } 将 ~ 替换为 @ ~Html.TextAreaFor(model => model.About, 10, 300, new { htmlAttributes = new { ~class= "form-control" } })
    • 我得到错误:对象不支持属性或方法“可调整大小”
    • 好的,可以看看为什么它不工作了。这是一个多边形填充,你可以试试npmjs.com/package/resize-polyfill
    猜你喜欢
    • 1970-01-01
    • 2012-09-27
    • 2022-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 2017-11-08
    相关资源
    最近更新 更多