有没有办法让这个jQuery在IE8中运行?

时间:2015-07-02 22:44:35

标签: javascript c# jquery internet-explorer-8 ie8-browser-mode

我有这个jQuery:

$(document).on("keyup", "[id$=explainPaymentTextBox]", function (e) {
    console.log("explainPaymentTextBox keyup reached");
    while ($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
        $(this).height($(this).height() + 1);
    };
});

...和这个相关的C#代码隐藏:

boxPaymentExplanation = new TextBox()
{
    CssClass = "dplatypus-webform-field-input",
    ID = "explainPaymentTextBox"
};
boxPaymentExplanation.Width = 660;
boxPaymentExplanation.Style.Add("TextMode", "MultiLine");
boxPaymentExplanation.TextMode = TextBoxMode.MultiLine;
this.Controls.Add(boxPaymentExplanation);

...在Chrome中工作正常(文本框在向上移动时/在文本输入时垂直增长,以显示所有文本):

enter image description here

在IE中,虽然(浏览器模式= Internet Explorer 8,这显然是用户在这里看到的标准模式),但它不起作用:

enter image description here

(该文本框中有更多行文字,但不显示)。

是否有可能告诉IE整理并向右飞行,或者IE用户是否注定要有一个静态大小的文本框?

1 个答案:

答案 0 :(得分:1)

jQuery 2.x支持IE9 +

jQuery 1.x支持IE6 +

我假设你只使用2.x,因为你的代码在IE8中不起作用。

https://jquery.com/browser-support/