2015-07-02 96 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

回答

相關問題