js代码
<script src="js/jquery.auto-grow-input.js"></script> <script> $(function(){ $('#demo-input').autoGrowInput({ minWidth: 180, maxWidth: function(){ return $('#demo-input-container').width()-40; }, comfortZone: 40 }); }); $(window).resize(function(){ $('#demo-input').trigger('autogrow'); }); </script>