2015-07-02 93 views
0

我有了这个jQuery的:有没有办法让这个jQuery在IE8中工作?

$(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用户注定要有一个静态大小的文本框?

+0

你试过改变textarea的rows属性吗? – Sushil

回答

相关问题