开发者

textarea height and width in jQuery mobile?

I fixed the the height for text-area element in jQuery mobile and i got perfect height and width in portrait开发者_Python百科 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;');


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');


If you're setting the width and height, you don't need to set cols and rows. Try removing those values and the textarea should expand with your % values.

Also, is your textareas containing element set to expand?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜