Hey guys, thanks for helping me out
this is probably a really simple question, but im a newbie with js so here goes.
I want to use this autoresize plugin
http://james.padolsey.com/javascript/jquery-plugin-autoresize/
I downloaded the script, put it in my JS folder and pointed to it in my header like this: <script type="text/javascript" src="{$smarty.const._URL}/
js/autores
ize.jquery
.js"></scr
ipt>
now how can i make the textarea in the following form autoresize, i.e where do i need to add/change code.
====================form on my site =========================
<form action="" name="myform" method="post" id="myform">
<input type="hidden" id="c_username" name="username" value="Anonymous" class="inputtext" /><br />
<span style="color: #8c8c8c;">{$lang.your_comm
ent}:</spa
n><br />
<textarea id="c_comment_txt" name="comment_txt" style="width:470px" rows="5" onkeyup="textLimit(this, 400);"></textarea><br /><br />
<input type="hidden" id="c_vid" name="vid" value="{$uniq_id}" />
<input type="hidden" id="c_user_id" name="user_id" value="0" />
<br />
<input type="submit" id="c_submit" name="Submit" value="{$lang.submit_comme
nt}" class="inputbutton" />
====================/ form on my site =========================
on the plugin homepage it says that this is an example implementation:
====================Exampl
e implementation =========================
$('textarea#comment').auto
Resize({
// On resize:
onResize : function() {
$(this).css({opacity:0.8})
;
},
// After resize:
animateCallback : function() {
$(this).css({opacity:1});
},
// Quite slow animation:
animateDuration : 300,
// More extra space:
extraSpace : 40
});
====================/ Example implementation =========================
but where do I add this?
again, thanks for the help :)
~Abrasax7
$(document).ready(function
$('textarea#c_comment_txt'
// On resize:
onResize : function() {
$(this).css({opacity:0.8})
},
// After resize:
animateCallback : function() {
$(this).css({opacity:1});
},
// Quite slow animation:
animateDuration : 300,
// More extra space:
extraSpace : 40
});
});