Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:41:39+00:00 2026-06-10T13:41:39+00:00

Please keep in mind I’m still in the early learning stage of jQuery. Having

  • 0

Please keep in mind I’m still in the early learning stage of jQuery.

Having animation performance issue with the code below. It doesn’t show performance issues in jsfiddle but on the website I’m constructing the .js file and html file is huge!

The purpose of the code is to animate a textarea height on focus and blur the box to the original height.

I thought combining the functions might increase performance but the opposite happened.

$("#productsServiceDescription, #targetAudienceDescription").focus(function() {

    $(this).animate({
        height: 100
    }, "normal"),

    $(this).blur(function() {
        $(this).animate({
            height: 51
        }, "normal")
    });
});​    

Code Here

http://jsfiddle.net/clearpixelsolutions/Yn477/

Here’s the code with functions separated, performance is so so on the animation, but combined like shown above its awful.

$("#productsServiceDescription, #targetAudienceDescription").focus(function() {

    $(this).animate({
        height: 100
    }, "normal"),
});
$("#productsServiceDescription, #targetAudienceDescription").blur(function() {

    $(this).animate({
        height: 51
    }, "normal")
});​

I was wanting to combine the functions to eliminate reproducing the id tags. I will have a total of 15 ids or so using this function.

I’m hoping someone might tell me what I’m doing wrong and how to optimize the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:41:40+00:00Added an answer on June 10, 2026 at 1:41 pm

    Using class will be better solution, like

    $(".one_full_a3 textarea").focus(function() {
        $(this).animate({
            height: 100
        }, "normal");
    }).blur(function() {
        $(this).animate({
            height: 51
        }, "normal");
    });​
    

    See the updated demo​

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please keep in mind that I'm rather new to how MVC, Json, jQuery, etc.
I was just wondering why the following code doesn't work (please keep in mind
I am new to programming in general so please keep that in mind when
To keep things simple, please allow the assumption that some code requires the use
Please i need help, this code below works fine on my localhost, php5.3+ but
Please keep in mind that I am new to world of .Net and F#.
Please keep in mind that I know nothing about Matlab. Matlab Builder JA lets
Please keep in mind that I'm a really newbie Cocoa developer Scenario: I've a
Note: please keep in mind that this is not a generic question on the
I have the following strange problem in Oracle (Please keep in mind that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.