Apr 11, 2010

11:58 PM - , No comments

Auto size text box

There is a way to auto size a asp text box or others web controls with jquery library. The steps:

1. Register onResize event:
window.onresize = windowOnResize;

2. Implement windowOnResize function:
Suppose that you want your txtLogView displays 800px of width and 500px of height, add this snip code:

var myWidth = 800px;
var myHeight = 500px;
var myStyle = "width:" + myWidth + ";height:" + myHeight ;
$('#<%=txtLogView.ClientID%>').attr('style', myStyle);

0 comments:

Post a Comment