2009-07-22 17 views
0

我在同一個站點上使用YUI重置和jQuery AutoGrow在一起。它在Firefox上正常工作,但IE 7表現不佳。 textarea的發展方式很大,即使只有少量的文本。jQuery的自動增長與yui-reset在IE7中導致不良行爲

下面是一個演示問題的例子。如果我註釋掉重置樣式表,則自動增長行爲正確。

我希望有一些簡單的CSS,我可以重寫,將解決這個問題。我很想進入這個項目,以切換遠離YUI重置。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head> 
    <title></title> 
    <link href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css" rel="stylesheet" type="text/css" /> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> 
    <script src="http://www.aclevercookie.com/files/jquery.autogrow.js" type="text/javascript"></script> 
    <script type="text/javascript"> 
     $(function() { 
      $("textarea").autogrow(); 
     }); 
    </script> 
    <style type="text/css"> 
     textarea 
     { 
      width: 99%; 
      line-height: 18px; 
     } 
    </style> 
</head> 
<body> 
    <textarea>abc</textarea> 
    <textarea>this quantity of text should not cause the textarea to grow yet.</textarea> 
</body> 
</html> 

回答

0

我在IE8中遇到了同樣的問題,而不是它與YUI重置有關,它似乎是導致問題的YUI字體。

通過將font-size設置爲1em來修復它。放手吧。