views:

720

answers:

5

hi to all

I know that combining two framework prototype and jquery is not a good idea. But I already a lot of code made by prototype, But when I discovered jquery I decided to use this because there is some methods and functions advances than prototype.

My question is I was using jquery autogrow but it was not work if I am using prototype at the same time. Even I was followed the jquery instructions regarding "using jquery with other libraries"

any help would greatly appreciated

in the head

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.autogrow.js"></script>
<script> 
jQuery.noConflict()
jQuery(document).ready (function() {

jQuery('#expanding').autogrow({
 maxHeight: 100,
 minHeight: 30,
 lineHeight: 16
});

});
</script>

in the body

<body>
    <textarea name="" cols="50" rows="" id="expanding"></textarea>
</body>
+1  A: 

For starters, you should always use the type attribute with <script> tags. You should make sure you end each line with a semicolon ;)

<script type="text/javascript"> 
jQuery.noConflict();
cpharmston
A: 

Try including prototype after jquery and jquery.autogrow in your sequence of script includes.

JRL
A: 

hi,

thanks to both of you,

I was followed your instructions but no luck, still not working...

Any help and ideas....

Thanks

Tirso

tirso
+1  A: 

I'm assuming you have the latest version of autogrow from http://plugins.jquery.com/project/autogrow. There is a minor bug in that version that prevents it from working when you're using prototype. It's simple fix; the error is on line 103 of jquery.autogrow.js

You need to change:

if ($.browser.msie)

to:

if (jQuery.brower.msie)

Your code should work once you fix that.

P.S. Please remember to add comments or edit your question, when appropriate, instead of adding an answer - the 'answer' you just added is not technically an answer.

brianpeiris
hi brianpeiris,Thank you so much, it works like a charm. Your the great!sorry for not properly using add comment. Tirso
tirso
You're welcome. Don't forget to mark an answer as accepted ;)
brianpeiris
A: 

I solved it by changing the css padding and line-height:

textarea{padding:4px; font-size:12px; line-height:14px}

this one works

nonolok