Link to home
Start Free TrialLog in
Avatar of Elxn
ElxnFlag for United States of America

asked on

Textarea height getting mysteriously set

I have a page that has posts on it and there is a textarea for putting comments in.  The textarea height is somehow getting set by a script I'm using to automatically expand the textarea height.  For some reason the height is getting set for the text area and it is way to big vertically.  

I was hoping someone could help me figure out how to put the height of the textarea to the value i actually define in the css file.  NOTE: using !important isn't an option as this causes the textarea to not expand with the plugin.

Page with big textarea

Plugin for textareas

Thanks for any help!
Avatar of sundaramkumar
sundaramkumar

post your code, that way people can help you.
Avatar of Elxn

ASKER

The code is all visible on the page.  There are several css files but what throws them off and makes the textarea too big is the plugin.  I took the plugin out and it worked just fine.  But I want to use the plugin.

You can use chrome or firefox to inspect the code, its all right there as you can see in the links i provided in my first post.

Here is the direct link to the plugin code i'm using on my site:  http://girlzunderground.com/new/code/jquery.elastic.source.js
This is probably the function in the script where you will need to deal with the height being set by the plugin.  You might have to experiment with the curated height to get what you need:

function setHeightAndOverflow(height, overflow){
				
					var curratedHeight = Math.floor(parseInt(height,10));
					if($textarea.height() !== curratedHeight){
						$textarea.css({'height': curratedHeight + 'px','overflow':overflow});
					}
				}
	

Open in new window

                 

Cd&
ASKER CERTIFIED SOLUTION
Avatar of Elxn
Elxn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great! Glad you got it solved. :^)

Cd&
Avatar of Elxn

ASKER

I solved my own question, you can put the points to 0 as I don't think I can do this myself.