I am trying to figure out a way to resize a text area using JQM when the device rotates. Basically, I have a text area that looks good when it loads, whether in portrait or landscape, but when the device is rotated, it does not resize. Here is a bit of what the code looks like:
.message-entry{
margin-left:10px;
margin-right:0;
margin-bottom:-20px;
}
and the HTML:
<footer data-role="footer" id="footer" data-theme="b" data-position="fixed">
<label class="label-message-entry" for="chatMessageEntry">Enter a message:</label>
<textarea rows="8" name="textarea" class="message-entry" id="chatMessageEntry"></textarea>
<a id="chatReplyButton" class="reply-button" data-role="button" data-icon="plus">Reply</a>
</footer> <!--end footer-->
and then the orientationchange event:
$(window).bind( 'orientationchange', function(e){
var newWidth = $(window).width();
$('.message-entry').css({'width':newWidth + 'px'});
});
any ideas? Thanks!
Have you tried giving the textarea a min-width within a media query?