Forum Moderators: open
I can do it in PHP which is pretty easy, but the page has to refresh thus losing the data.
I`ve looked through the vBulletin js code and can`t seem to find the javascript function that makes this work. I can see the function names in the code, but can`t find the js.
Anyway, any of you guys know of a little code snippet that creates this effect?
Thank you.
have a peep at this 'de luxe' version. ;)
It has horizontal control also.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>textarea expander</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background-color:#ddd;
}
#theForm {
font-family:verdana,arial,helvetica,sans-serif;
}
#theForm fieldset {
margin: 30px auto;
padding:10px;
background-color:#ccc;
border:8px inset #ccc;
}
#theForm textarea {
font-size:14px;
}
#theForm div {
text-align:center;
}
#theForm input {
width:95px;
font-size:14px;
margin:5px 0px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
var df=document.forms;
function initiateWidth() {
df[0][0].style.width=df[0][1].offsetWidth+"px"
}
function expandTextarea(which) {
if(which==0) {
df[0][1].rows=df[0][1].rows+1;
df[0][0].style.height=df[0][1].offsetHeight+25+"px";
}
else {
df[0][1].cols=df[0][1].cols+1;
df[0][0].style.width=df[0][1].offsetWidth+"px";
}
}
//]]>
</script>
</head>
<body onload="initiateWidth()">
<form id="theForm" action="#">
<fieldset>
<textarea cols="22" rows="2"></textarea>
<div>
<input type="button" value="expand rows" onclick="expandTextarea(0)"/>
<input type="button" value="expand cols" onclick="expandTextarea(1)"/>
</div>
</fieldset>
</form>
</body>
</html>
birdbrain
birdbrain