Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Textarea height getting mysteriously set

Posted on 2015-02-12
6
Medium Priority
?
64 Views
Last Modified: 2015-02-18
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!
0
Comment
Question by:Elxn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:sundaramkumar
ID: 40607595
post your code, that way people can help you.
0
 
LVL 2

Author Comment

by:Elxn
ID: 40608000
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40608161
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&
0
Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

 
LVL 2

Accepted Solution

by:
Elxn earned 0 total points
ID: 40608316
I wanted to get this done so I looked at it and discovered that the script probably puts in a <div> into the page and I had in my CSS a style that affected all <div> tags inside a section.  So the height was getting set too big because the style applying to the div tag appended to the DOM was being set too big by my CSS code targeting all <div> tags.  

I changed to CSS to not apply to all <div> tags in the section and the problem was solved.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40608328
Great! Glad you got it solved. :^)

Cd&
0
 
LVL 2

Author Closing Comment

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question