在jQuery手机textarea的高度和宽度? [英] textarea height and width in jQuery mobile?

查看:83
本文介绍了在jQuery手机textarea的高度和宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我修正了jQuery mobile中文本区域元素的高度,并且我在纵向上获得了完美的高度和宽度,但在横向上,宽度不会放大。谁能帮我?

I fixed the the height for text-area element in jQuery mobile and i got perfect height and width in portrait but in landscape the width doesn't enlarge. can any one help me? thanks in advance.

HTML:        <textarea cols="55" rows="50" name="textarea" id="newMarkCompleteCommentText" style="background-color:White;width:95%;height: 50px;"></textarea>

IN JS:
    $('#newCommentText').attr('style', 'background-color:White;font-size:18px;height:7em;');


推荐答案

尝试设置width:auto。此外,而不是.attr('style',...)您可以使用.css('attribute','value')

Try setting "width: auto". Also, instead of ".attr('style', ...)" you can use ".css('attribute', 'value')"

$('#newCommentText').css('background-color', 'white').css('font-size', '18px').css('height', '7em').css('width', 'auto');

这篇关于在jQuery手机textarea的高度和宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆